Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 3 wars set up on a Tomcat instance - these wars are being served at:

I have Apache on the same machine. I am trying to set Apache up so that I can access the 3 wars in the following way:

I have tried following the example Using Virtual_Host and mod_proxy together, but it is not working correctly. When I visit the browser gets sent a 302 towards and that in return gives a 400 error.

If I visit (ie query Tomcat directly) then I get the site I am expecting, so the DNS is set up correctly, and the war is correctly deployed.

My Apache configuration file (/etc/httpd/conf.d/sites.conf) is as follows:

Listen 9024
<VirtualHost *:9024>
    ErrorLog logs/error_log
    CustomLog logs/access_log common
    ProxyPreserveHost On
    ProxyPass /
    ProxyPassReverse /

I am using Apache 2.2.3 and Tomcat 6.0.14. Tomcat is configured pretty much normally:

<Host name="localhost"  appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
  <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
       prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>

The wars are in CATALINA_HOME/webapps/war1.war, etc.

What am I doing wrong? Is there something I should be looking for in the main Apache configuration?

share|improve this question
up vote 0 down vote accepted

Quick edit: are you sure it's Apache giving you the error 400, btw? Use 'curl -v ' and examine the header traffic to ensure it's Apache that's 400'ing.

Hmmm, it looks right. Do you have a 'NameVirtualHost *:9024" somewhere in your config? And, are you sure the mod_proxy* modules are actually enabled via LoadModule somewhere?

Try using an alternate method:

<Location />
  ProxyRequests Off
  ProxyPreserveHost On
  # Perhaps your Tomcat is HTTP/1.1 buggy?
  SetEnv force-proxy-request-1.0 1
  SetEnv proxy-nokeepalive 1

I suggest setting your 'LogLevel debug' to examine the actual traffic to determine what's going wrong.

share|improve this answer

Your Answer


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.