Problems restricting access using Apache
Posted
by
Tola Odejayi
on Server Fault
See other posts from Server Fault
or by Tola Odejayi
Published on 2011-01-02T21:33:35Z
Indexed on
2011/01/02
21:55 UTC
Read the original article
Hit count: 152
I've set up XAMPP on a Windows 7 machine, and I want to restrict access to the htdocs folder to only requests from the local machine. C:\Xampp\htdocs is the web root folder.
I have the following in my apache/conf/httpd.conf file:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "C:/Xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
order deny,allow
deny from all
allow from 127.0.0.1
allow from localhost
</Directory>
All my .htaccess files are blank.
But when I navigate to the web root folder via a browser, I get the following message:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
I tried adding the IP restrictions to the <Directory>...</Directory>
, but it made no difference.
What am I doing wrong here?
© Server Fault or respective owner