Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wamp Apache - Allow localhost

There are other questions similar to this but don't answer my problem.

This is the default httpd.conf:

<Directory "C:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

and it allows only 127.0.0.1, but I want to allow also localhost and 192.168.x.x (my private ip).

Well, the other answers are: put Allow from all and uncomment in hosts file the line 127.0.0.1 localhost; but I read that is unsecure or not reccomended.

So I've tried this:

<Directory "C:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 192.168.x.x
    Allow from localhost
</Directory>

It works for 192.168.x.x, but not for localhost (gets error: 403 Forbidden, You don't have permission to access / on this server.)

1) How can make it works?

2) Maybe is required to uncomment in hosts file the line 127.0.0.1 localhost ?

3) Is it really more secure than Allow from all?

like image 570
Fred K Avatar asked May 22 '13 09:05

Fred K


2 Answers

Lets keep it simple, try this

<Directory "C:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 ::1 localhost 192.168 
</Directory>

::1 is the IPV6 equivalent of 127.0.0.1

I would use the first 3 of the quartiles 192.168.0 ( assuming your third quartile is 0 )

like image 197
RiggsFolly Avatar answered Oct 31 '22 07:10

RiggsFolly


Update your httpd.conf to this, and you will be able to get to localhost on WAMP.

<Directory "C:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
    #   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 192.168.x.x

    Allow from ::1
</Directory>
like image 37
bigbluetaxi Avatar answered Oct 31 '22 08:10

bigbluetaxi