From SlackWiki
Revision as of 03:02, 2 June 2009 by Erik (talk | contribs) (Copy from old, had no category, placed in Tips)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.conf file
Apache2 (Slackware 12.0+): /etc/httpd/extra/httpd-users.conf file
...and add:
<Directory /home/*/public_html/cgi-bin/>
Options ExecCGI
SetHandler cgi-script

Then, presuming that UserDir is set to public_html, a cgi program example.cgi could be loaded from that directory as:


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.org
DocumentRoot /home/MyDomain/public_html
ErrorLog /var/log/MyDomain/error.log
ScriptAlias /cgi-bin/ "/home/MyDomain/public_html/cgi-bin/"