Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

locking down Apache to localhost

Tags:

apache

Having recently moved from Win XP (x86) to Win 7 (x64), I have also had to reinstall Apache. I have installed the 64 bit versions of Apache (2.4.3) and PHP (2.4).

I installed it to c:\Apache24.

I have got it up and running, but now I need to lock it down to my local PC Only.

If I have:

<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny
Allow from all
# New directive needed in Apache 2.4.3 apparently: 
Require all granted
</Directory>

this works fine, but if I change it to:

<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny
Allow from 127.0.0.1
# New directive needed in Apache 2.4.3 apparently: 
Require all granted
</Directory>

(or 'Allow from Localhost' or 'Allow from 192.x.y.z')

I get an access denied error. How can I get round this?

Everything is installed using my login, which has full local admin rights.

like image 662
IGGt Avatar asked Nov 27 '22 21:11

IGGt


1 Answers

Replace

Order allow,deny
Allow from all
Require all granted

by just

Require local

More: http://httpd.apache.org/docs/2.4/en/mod/mod_authz_host.html

like image 170
François Avatar answered Dec 06 '22 05:12

François