Apache-cgi
Jump to navigation
Jump to search
To enable a cgi directory for each user
In order to give each user their own cgi-bin directory, edit the:
- Apache1 (Slackware pre-12.0):
/etc/httpd/httpd.conffile - Apache2 (Slackware 12.0+):
/etc/httpd/extra/httpd-users.conffile
- ...and add:
<Directory /home/*/public_html/cgi-bin/>Options ExecCGISetHandler cgi-script</Directory>
Then, presuming that UserDir is set to public_html, a cgi program example.cgi could be loaded from that directory as:
http://example.com/~rbowen/cgi-bin/example.cgi
To enable a cgi directory for each virtual host
In the Virtual Host section of your apache config file (/etc/apache/httpd.conf) add the ScriptAlias line below.
<VirtualHost *:80>ServerName www.MyDomain.orgDocumentRoot /home/MyDomain/public_htmlErrorLog /var/log/MyDomain/error.logScriptAlias /cgi-bin/ "/home/MyDomain/public_html/cgi-bin/"
</VirtualHost>