permission denied to access localhost

1.7k views Asked by At

I'm using ubuntu 15.04 with apache2 I add this code below to make my web site only accessible from localhost

            <Directory />
                    Order deny,allow
                    Deny from all
                    Allow from localhost
                    Options -Indexes -ExecCGI
            </Directory>

but unfortunately this don't give me permission I know that the order of allow and deny is important, here I'm excpecting that apache2 deny from any host or ip and then just allow localhost, Do what I said is right or I'm misunderstanding how this works ?

1

There are 1 answers

0
Hamza Hanafi On

I solved the problem by replacing this line Allow from localhost by this one Allow from 127.0.0.1

I hope someone explain to me why should I use the IP instead of locahost