Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

On my server I have two tomcat applications: 'hidden' and 'open'. The hidden application should only be available for the local network 192.168.0.0. The open app should be available for all networks.

The Applications run on Tomcat 7.0.6 and the requests are forewarded from Apache 2.2.17 with mod_proxy_ajp. All this runs on a FreeBSD 8.2 server.

The Apache web server also handles the root website, which is static. There is no virtual host configured (only one host).

I havn't found any example configuration so far, so I just tried to combine two simple configurations:

ProxyRequests Off
ProxyPreserveHost On

<Proxy /hidden>
  Order Deny,Allow
  Deny from all
  Allow from 192.168
</Proxy>

<Proxy /open>
  Order Deny,Allow
  Allow from all
</Proxy>

ProxyPass /hidden ajp://localhost:8009/hidden/
ProxyPassReverse /hidden ajp://localhost:8009/hidden/

ProxyPass /open ajp://localhost:8009/open/
ProxyPassReverse /open ajp://localhost:8009/open/

With this configuration both applications are accessible from all networks. I already played with the Allow / Deny settings. This one seemed the most logical to me.

Does anybody have an idea what's wrong with my configuration?

Oli

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The <Proxy> directive takes a full URL - since your virtualhost may have more than one of those, the directive is more suited to when you're using it as a full proxy.

Try changing your directives to <Location> blocks, that should apply the permissions in the way you want:

<Location /hidden>
  Order Deny,Allow
  Deny from all
  Allow from 192.168
</Proxy>

<Location /open>
  Order Deny,Allow
  Allow from all
</Proxy>
share|improve this answer
    
Perfect, that did the trick! Thank you –  oli Mar 25 '11 at 14:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.