Search code examples
securityapacheaccess-controlapache-configlan

Apache: how to limit virtual dir to local network


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?


Solution

  • <Directory /users/me/private>
        Order deny,allow
        Allow from 192.168.4
        Deny from all
    </Directory>