403 Forbidden (trying to exec dir as script) but apache config file seems OK

Discussion in 'Server Operation' started by rjamesd, Aug 24, 2007.

  1. rjamesd

    rjamesd New Member

    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:


    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] 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 [email protected]

    DocumentRoot /var/www/
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory /usr/lib/cgi-bin/>
    AllowOverride None
    Options +ExecCGI -MultiViews -FollowSymLinks
    Order allow,deny
    Allow from all

    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 ::1/128

  2. falko

    falko Super Moderator ISPConfig Developer

  3. rjamesd

    rjamesd New Member

    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:

    works, and is the same as:


    should work the same as:
  4. rjamesd

    rjamesd New Member

    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

    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 ?)

Share This Page