Easy way to install and configure "Apache" server in Ubuntu 14.04
1.Install apache:
sudo apt-get install apache2
2. In /etc/apache2/sites-available/000-default.conf :
ScriptAlias /cgi-bin/ /var/cgi-bin/
<Directory "/var/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
3. Create cgi-bin folder under /var :
sudo mkdir /var/cgi-bin
4. Place the script file under cgi-bin :
cp soucepath /var/cgi-bin/
sudo chmod 755 yourfile.py (make script executable)
5. Execute the following commands:
ls -l /etc/apache2/mods-enabled/ | grep cgi
ls -l /etc/apache2/mods-available/ | grep cgiln -s /etc/apache2/mods-available/cgid.load /etc/apache2/mods-enabled/
ln -s /etc/apache2/mods-available/cgid.conf /etc/apache2/mods-enabled/
ls -l /etc/apache2/mods-enabled/ | grep cgi
6. Restart apache :
service apache2 restart
7. Run the file in browser :
localhost/cgi-bin/yourfile.py
Regards,
Gokul Karthik M
QA Engineer
gokul.hotspot@gmail.com
Thanks for sharing this gokul.... It helps me a lot
ReplyDeleteThanks for leaving a comment
Delete