I've asked this question in a few places and I've found no answer. It should be pretty simple and a pretty common problem. Unfortunately I know nothing about tomcat and mod_proxy so I'm unable to figure it out.
I have a few apps running in tomcat, installed as wars and I can access them at myserver.com:8080/myapp
I simply want to create an apache vhost that forwards myapp.myserver.com to this myserver.com:8080/myapp using mod_proxy.
Hudson is a perfect example, there's no extra config, just a deployed war. So I set up the following apache vhost:
<VirtualHost *:80> ServerName hudson.myserver.ca ProxyPreserveHost On ProxyPass / http://localhost:8080/hudson ProxyPassReverse / http://localhost:8080/hudson </VirtualHost> and my proxy.conf is:
<IfModule mod_proxy.c> ProxyRequests Off <Proxy *> AddDefaultCharset off Order deny,allow Allow from all </Proxy> # Enable/disable the handling of HTTP/1.1 "Via:" headers. # ("Full" adds the server version; "Block" removes all outgoing Via: headers) # Set to one of: Off | On | Full | Block ProxyVia On </IfModule> Every request on every app has the same behavior. I go to hudson.myserver.ca for example, and it for some reason forwards on to hudson.myserver.ca/hudson, which gives a tomcat 404 that says
The requested resource (/hudsonhudson/) is not available.
happens for hudson, jira, confluence, and any other app.
What's with the extra 'hudson' and why isn't this working?
hudson.myserver.ca. Logs say: hudson.myserver.ca:80 206.248.167.169 - - [20/Oct/2009:18:57:36 -0400] "GET / HTTP/1.1" 302 - "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9" hudson.myserver.ca:80 206.248.167.169 - - [20/Oct/2009:18:57:36 -0400] "GET /hudson/ HTTP/1.1" 404 389 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9"