Apache
Install Apache
- sudo apt-get install apache2
- sudo /etc/init.d/apache2 start
- sudo /etc/init.d/apache2 stop
- sudo /etc/init.d/apache2 restart
Main Configuration File
- sudo nano /etc/apache2/apache2.conf
- sudo nano /etc/apache2/sites-available/default
- sudo nano /var/log/apache2/error.log
- /var/www/
PHP
Install PHP- sudo apt-get install php5 libapache2-mod-php5
PERL
- Perl is pre-installed.
- whereis perl to see the location where perl is installed.
- perl-v check the version which is in use.
- Use /usr/lib/cgi-bin to put perl files.
- Make the changes in BOLD in the Virtual host (/etc/apache2/sites-available/default)
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AddHandler cgi-script cgi pl
Order allow,deny
Allow from all
</Directory>
- Change the permission in the perl script to 755 (sudo chmod 755 test.pl)
- Now run http:localhost/cgi-bin/test.pl
- Sample perl script test.pl
print "Content-type: text/html\r\n\r\n"; -> without this line it will give an internal server error
print "Hello there";
- Running Perl in Terminal
No comments:
Post a Comment