Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 need to host two sites with Tomcat. This is what is in my Apache conf:

<VirtualHost *:80>
    DocumentRoot /root/tomcat/webapps/PROJECT

To access the site, I can access only by the I can't access the index, for example:

And what for the case when I want host another site ?

My idea:

<VirtualHost *:80>
    DocumentRoot /root/tomcat/webapps/PROJECT1

But I've had no success.

How would I solve this?

share|improve this question

Using Apache and Tomcat together, delivering JAVA 'files' (servlets, jsp, etc.) doesn't work the way you sketched up. The way you did it there, you can only access the files and they are delivered depending on their mime type.

As a first step you should read up on reverse proxying and in your case the modules mod_proxy_http and or mod_proxy_ajp. I don't know what experience level you got, so I simply write up some lines you should adapt:

LoadModule proxy_module /usr/lib/apache2/modules/
LoadModule proxy_ajp_module /usr/lib/apache2/modules/
<IfModule mod_proxy_ajp.c>
   <Location />
      ProxyPass ajp://
      ProxyPassReverse ajp://

In a standard Linux environment you can install those modules with your package provider and enable them with a2enmod mod_proxy_ajp. This should also install mod_proxy as dependency. In that case you drop the LoadModule directives mentioned above.

The <Location /> directive is what handles all requests directed to your domain. So delivers the index. There are some more considerations (security when using mod_proxy) and some such, but it should point you in the right direction.

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.