views:

34

answers:

1

Hi guys,

I am having weired problem, after adding my virtual host conf entry localhost is not working (getting forbiden 403) but 127.0.0.1 does (all accessed via browser - http), here you have my conf:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/MyData/__www/default"
ServerName localhost
<Location />
        Order deny,allow
        Deny from All   
        Allow from 127.0.0.1
        Options +FollowSymLinks -Indexes            
</Location>
</VirtualHost>

The funny thing is that when I change allow from to:

 Allow from localhost

localhost works but 127.0.0.1 not, localhost is mapped properly in hosts file.

please help,

cheers, /Marcin

+1  A: 

On some systems, localhost maps to an IPv6 address, ::1. Try:

Allow from 127.0.0.1,::1
Lekensteyn
not really, getting: The specified IP address is invalid. - on Apache restart
Marcin
ok, I had to remove from hosts file: ::1 and on the Mac there is one more entry which needs to be removed: "fe80::1%lo0 localhost" - after that all works.
Marcin