4

We are running apache as a proxy server and have tomcat behind apache. We are using server_status module but when we try to access server_status as in https://host.com/server-status it redirects to tomcat and we get 404 error. I am quite new to this, tried going through apache docs but unable to figure out the solution. Fyi.We have ssl enabled

Current ssl.conf settings:

  ProxyRequests     Off
  ProxyPreserveHost On

  <Proxy http://localhost:8081/*>
      Order deny,allow
      Allow from all
  </Proxy>

  ProxyPass         /  http://localhost:8081/
  ProxyPassReverse  /  http://localhost:8081/
  ProxyPassReverse   /  http://myhost:8081/


    <Location /server-status>
            SetHandler server-status
            Order deny,allow
            Deny from all
            Allow from 10.90
    </Location>

After suggested changes

 ProxyRequests     Off
 ProxyPreserveHost On

<Proxy http://localhost:8081/*>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass         /server-status !
ProxyPass         /  http://localhost:8081/
ProxyPassReverse  /  http://localhost:8081/
ProxyPassReverse   /  http://myhost:8081/

Edit 2:

Change was required to httpd.conf and I added the ProxyPass /server-status ! under the directive for proxy module configuration and it works.

2 Answers 2

5

You can use ! in the ProxyPass directive for proxy exceptions. Something like

ProxyPass /server-status !

ought to do it.

See apache docs for ProxyPass directive for more: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass , especially

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

5
  • 1
    Unfortunately this is not working from me. This should be the ideal solution but it isnt.
    – f-z-N
    Jun 9, 2014 at 14:26
  • It could be the order of things. Update your question with the new configs.
    – KM.
    Jun 9, 2014 at 14:43
  • Updated the question with the new config
    – f-z-N
    Jun 10, 2014 at 7:48
  • Place it after the </Location> line and restart the web server
    – KM.
    Jun 10, 2014 at 13:59
  • 1
    I was updating ssl.conf and seems like httpd.conf was supposed to be updated with your suggestion. But, its working now. Thank you KM
    – f-z-N
    Jun 12, 2014 at 6:58
0

I had a lot of sites and some of them had 'Redirect permanent' in it. For some reason it doesn't work (at least for me).

I use the /server-status for monitoring so I only had to connect to it from another server inside the local LAN. So I created an extra Vhost with the local IP as the ServerName like this:

<VirtualHost *:80>
   ServerName   <<local_server_ip>>
   ServerAlias  <<local_server_ip>>
   ServerAdmin  [email protected]

        DocumentRoot "/var/www/html"

    Options Indexes FollowSymLinks
</VirtualHost>

I'm not an expert but it worked for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .