On my Apache 2.x server at home, I have a number of virtual directories. I've set up my router so that I can access Apache from the internet. I need to keep one of those virtual dirs (/private) from being accessed outside my home network LAN. So given /private, how do I configure Apache to only serve requests to /private from 192.168.4.x?
+1
A:
<Directory /users/me/private>
Order deny,allow
Allow from 192.168.4
Deny from all
</Directory>
chaos
2009-04-02 16:10:11
I tried the following:Alias /private /users/me/private<Directory /private> Order allow,deny Allow from 192.168.4 Deny from all</Directory>I restarted Apache yet I still can access the site via the Internet. I tested it using my smartphone browser running on the Verizon network. ??
2009-04-02 16:28:30
Use the actual system pathname to the directory, /users/me/private, in the Directory config, or use a Location instead.
chaos
2009-04-02 16:59:04
Using the actual path now give me a '403 Forbidden' error from both outside and inside of my network:You don't have permission to access /private on this server.
2009-04-02 17:25:13
Sorry, wrote the Order directive wrong. Should be deny,allow. Edited to fix.
chaos
2009-04-02 17:31:03
(I do that sometimes since the semantics of the Order directive are the exact opposite of what they seem to me like they should be.)
chaos
2009-04-02 17:32:27
That worked! Thanks.
2009-04-02 17:39:54