You are not logged in.

#1 2013-04-17 17:01:07

kaipee
Member
From: Belfast, UK
Registered: 2012-07-07
Posts: 200

[SOLVED] Can't figure out why 403 forbidden on local machine

OK so this is bound to be something very simple, but I have come to the stage whereby I cannot see the forest for the trees as they say.

I have just installed a fresh LAMP setup on my local machine for development.

- Browsing to localhost/test.php and localhost/index.php output the correct php documents.
- Browsing to just localhost gives 403.

Details are as follows:

http:x:503:502:http:/srv/http:/bin/false
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "/srv/http">
    Options FollowSymLinks Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<VirtualHost *:80>
        DocumentRoot "/srv/http"
        ServerAdmin root@localhost
        ServerAlias localhost
        ErrorLog "/var/log/httpd/127.0.0.1-error_log"
        CustomLog "/var/log/httpd/127.0.0.1-access_log" common
        <Directory /srv/http/>
                DirectoryIndex index.htm index.html
                AddHandler cgi-script .cgi .pl
                Options ExecCGI FollowSymLinks MultiViews +Includes
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName sure2dev.co.uk
        ServerAlias www.sure2dev.co.uk
        DocumentRoot "/srv/http/sure2dev.co.uk/public_html"
        ServerAdmin development@******
        ErrorLog "/var/log/httpd/sure2dev-error_log"
        CustomLog "/var/log/httpd/sure2dev-access_log" common
        ScriptAlias /cgi-bin/ /srv/http/sure2dev.co.uk/public_html/cgi-bin/

        <Directory /srv/http/sure2dev.co.uk/public_html/>
                DirectoryIndex index.htm index.html index.php
                AddHandler cgi-script .cgi .pl
                Options ExecCGI FollowSymLinks MultiViews +Includes
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>

</VirtualHost>
[kaipee@S2S-keith~]$ sudo ls -al /srv/
total 16
drwxr-xr-x  4 root root 4096 Mar 14 19:20 .
drwxr-xr-x 20 root root 4096 Mar 24 19:15 ..
dr-xr-xr-x  2 root ftp  4096 Mar 14 19:20 ftp
drwxr-xr-x  3 http http 4096 Apr 17 14:37 http

[kaipee@S2S-keith~]$ sudo ls -al /srv/http/
total 20
drwxr-xr-x 3 http http 4096 Apr 17 14:37 .
drwxr-xr-x 4 root root 4096 Mar 14 19:20 ..
rw-r--r- 1 http http   86 Apr 17 13:51 index.php
drwxr-xr-x 3 http http 4096 Apr 15 16:10 sure2dev.co.uk
rw-r--r- 1 http http   20 Apr 17 14:37 test.php

Last edited by kaipee (2013-04-17 17:04:52)

Offline

#2 2013-04-17 17:04:36

kaipee
Member
From: Belfast, UK
Registered: 2012-07-07
Posts: 200

Re: [SOLVED] Can't figure out why 403 forbidden on local machine

....OMFG I just seen it. My apologies lol

For future reference:

I didn't have index.php defined within my default VirtualHost (I stupidly only added it to my other VirtualHost)

Offline

Board footer

Powered by FluxBB