Categories
BSD/Linux DrupalRecover Tech

Apache proxy restricion to local network

Old post copied forward – I never plan on using Apache again but maybe it helps someone else!

This wasn’t clearly spelt out anywhere I could find so here’s how I was able to restrict some of my websites to only be accessible from local addresses. This combined with the VPN setup seems a fairly decent way of limiting access. So if you want to allow Apache to server up Tomcat pages over AJP and have specific webapps limited to the local domain you can try this. Add this to your server setup – you fundamentally just wrap the former configuration in a location directive:

<Location /sa>
  Order Deny,Allow
  Allow from 172.12.0.0/24
  Allow from 127.0.0.0/24
  Deny from all
  ProxyPass ajp://172.12.0.20:8009/sa/
  ProxyPassReverse ajp://172.12.0.20:8009/sa/
</Location>

Where it used to just be:

ProxyPass /sa/ ajp://172.12.0.20:8009/sa/
ProxyPassReverse /sa/ ajp://172.12.0.20:8009/sa/

Leave a Reply

Your email address will not be published. Required fields are marked *