Wednesday 29 May 2013

How to run perl script i ubuntu ?

In ubuntu environment these are the steps which should follow to run perl script on localhost .

1. install httpd server  on ubuntu by
  sudo apt-get  install apache2 .

2.Go to "File System " .
3.Now start server by giving command "sudo /etc/init.d/apache2 [start/restart] .
4.If started successfully .Go to your browser .it will message "It works " .
5.Now Go to "File System " cd /var/www/ . check is there any folder name as cgi-bin .
6.If there then put your perl file there inside it ,if not then create a cgi-bin.
7.Give the permission to the cgi-bin to "chmod 777 cgi-bin".
8.Now you have to change the default path of Script aliasing.
9.so go to /etc/apache2/site-enabled/
10.There will a file called as 000-default .
11.In that section "Scriptalising" would be there.
12.open 000-default .
13. Instead of "/usr/lib/cgi-bin" change /var/www/cgi-bin/ also at Directory  /var/www/cgi-bin/.
14.Now again restart server as mention in 3 step .
15.run perl program by giving "localhost/cgi-bin/program.pl.

Note:Install perl first.

  

No comments:

Post a Comment