4

My application is deployed on ROOT folder in tomcat and it is connected to apache using proxy. Ex:-

ProxyPass / ajp://192.168.0.xx:8011/
ProxyPassReverse / ajp://192.168.0.xx:8011/

When I fire http://test.com/server-status it gives blank page and I receive below error in access.log

MY IP - - [03/Apr/2014:17:09:48 +0530] "GET /server-status HTTP/1.1" 404 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36"

But if I deploy my application on another directory, say Test, in tomcat and using below proxy setting in Apache

ProxyPass /Test ajp://192.168.0.xxx:8011/Test
ProxyPassReverse /Test ajp://192.168.0.xxx:8011/Test/

And now if I hit the url: http://test.com/server-status then it shows me the server page with status of server.

Below is my server-status configuration

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Satisfy any
    Allow from all
</Location>

Please let me know how to use server-status with deploying application as ROOT in tomcat.

  • Can you try the following? Stop Tomcat, delete your ROOT directory, rename your app as ROOT.war and restart tomcat. – Laurent C. Apr 3 '14 at 15:11
2

The /server-status page is a feature of Apache, not Tomcat. When you setup your ProxyPass rules at the top level of your URL, i.e. /, all traffic, including /server-status, is being forwarded to your Tomcat server, which doesn't serve a page at /server-status, hence the 404 being reported by Apache.

You can tell Apache NOT to proxy traffic that's bound for /server-status by adding your rules like so:

ProxyPass /server-status !
ProxyPass /Test ajp://192.168.0.xxx:8011/Test
ProxyPassReverse /Test ajp://192.168.0.xxx:8011/Test/

You can read more about this feature in the official Apache docs.

The ! directive is useful in situations where you don't want to reverse-proxy a subdirectory

References

0

You can add "ProxyPass !" to the location section. The result should look like this.

<Location /server-status>
    ProxyPass !
    SetHandler server-status
    Order deny,allow
    Satisfy any
    Allow from all
</Location>
  • 1
    Welcome to U&L. We generally like our answers to be long form here and to explain what they're doing or how they work. Code drops or configuration drops such as this are discouraged. – slm Dec 1 '14 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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