Marcin
Marcin

Reputation: 5579

127.0.0.1 works, localhost not - VH - Zend Ce, Mac

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

Upvotes: 0

Views: 2723

Answers (2)

Paul
Paul

Reputation: 395

This works:

127.0.0.1, ::1
          ^_______A space is needed before "::"

Upvotes: 2

Lekensteyn
Lekensteyn

Reputation: 66425

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

Allow from 127.0.0.1,::1

Upvotes: 1

Related Questions