cgi-bin 403 forbidden on apache2

essefbx picture essefbx · Jul 30, 2012 · Viewed 17.1k times · Source

I'm trying to load cgi-bin and I keep getting 403 permissions errors. When I tried to load cgi-bin/index.pl I get 404 page not found. Project permissions are set with chmod -R 755.

The server is running debian squeeze, apache2, with php5-cgi.

This is the /etc/apache2/sites-enabled/000-default:

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

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

error.log:

[Mon Jul 30 09:39:30 2012] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze13 with Suhosin-Patch configured -- resuming normal operations
[Mon Jul 30 09:50:44 2012] [error] Directory index forbidden by Options directive: /usr/lib/cgi-bin/

Answer

Brian Tompsett - 汤莱恩 picture Brian Tompsett - 汤莱恩 · Jan 26, 2015

(Question answered in the comments or edits. See Question with no answers, but issue solved in the comments (or extended in chat) )

The OP wrote:

Solved: changed the bottom section of 000-default to:

ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
</Directory>

then installed a few missing perl modules and it worked. Was able to open browser to /localhost/cgi-bin/index.pl.