Monday, 6 October 2008

httpd.conf improvement

I noticed today that apache2 on my laptop was executing files in
~/website/cgi-bin
but not in
~/website/cgi-bin/*/

anyway, turns out I had configured it incorrectly :(
originally I had added my local cgi-bin as a directory (useful for a directory of scripts in an odd place)
My old httpd.conf file
<VirtualHost *>
ServerName testhost
DocumentRoot /home/neil/ircwebsite
</Virtualhost>
<Directory /home/neil/ircwebsite/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>

but a ScriptAlias is shorter and works for cgi-bin AND all child folders therein
<VirtualHost *>
ServerName testhost
DocumentRoot /home/neil/ircwebsite
</Virtualhost>
ScriptAlias /cgi-bin/ /home/neil/ircwebsite/cgi-bin/

No comments: