Hi, I have a local webserver on my network, rockstar/ In browser, I type: http://rockstar/ this works - apache fetches index.html from /var/www However, when I type http://rockstar/cgi-bin/bugzilla/ it doesn't work, the browser displays: Forbidden You don't have permission to access /cgi-bin/bugzilla/ on this server. Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/4.4.4-8+etch4 mod_perl/2.0.2 Perl/v5.8.8 Server at rockstar Port 80 The /var/log/apache2/error.log has the following corresponding entry: [Fri Aug 24 15:38:56 2007] [error] [client 127.0.1.1] attempt to invoke directory as script: /usr/lib/cgi-bin/bugzilla I don't understand why because the redirecting and script cgi settings seem ok - see bold below. Any thoughts? NameVirtualHost * <VirtualHost *> ServerAdmin webmaster@localhost DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory /usr/lib/cgi-bin/> AllowOverride None Options +ExecCGI -MultiViews -FollowSymLinks Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
You are trying to access a directory: http://rockstar/cgi-bin/bugzilla/ You should try to access a CGI script instead, e.g. like http://rockstar/cgi-bin/bugzilla.cgi
but the DirectoryIndex should automatically find the index.cgi Yes, I can see that. error.log tells me that. But I thought it would be possible for Apache to find the index.cgi - there are settings for directory indexes, in the same way that it would find index.html In otherwords, if: http://localhost/ works, and is the same as: http://localhost/index.html then http://localhost/cgi-bin/bugzilla/ should work the same as: http://localhost/cgi-bin/bugzilla/index.cgi
Fixed it, no thanks to you guys - solution within I've fixed it - solution: my cgi-bin directory is /usr/lib/cgi-bin so: instead of using: ScriptAlias /cgi-bin /usr/lib/cgi-bin - which gave me the problems, I use this instead Alias /cgi-bin /usr/lib/cgi-bin <Directory /usr/lib/cgi-bin> AddHandler cgi-script cgi pl Options ExecCGI </Directory> I got this solution from: http://wiki.apache.org/httpd/DirectoryAsScript - took a lot of searching in google to find this. I'm using webmin to paste in the above script fragment in manually. I hope this puts others out of the misery I had to go through. I'm so pleased! same problem as in thread: http://www.howtoforge.com/forums/showthread.php?t=15137 (How to get localhost/cgi-bin/bugzilla/ to execute/display output of index.cgi ?)