Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7757635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:08:48+00:00 2026-06-01T13:08:48+00:00

I realize this question has probably been asked numerous times, but I have not

  • 0

I realize this question has probably been asked numerous times, but I have not been able to find a good, up-to-date answer. The only guide I have been able to find was from 2005 and was on tomcat 5. It seems a lot of the OS paths have changed.

Our situation is this:

We want to run multiple instances of tomcat 7 on a single server. Each tomcat serves up a different address. For instance, www.oursite.com should be served from a separate tomcat than test.oursite.com. So, for example the base tomcat installtion will sit in /opt/tomcat/ and the instance specific directories (this is what I could make out from that old tutorial) will be in /home/user1/some/path/ and /home/user2/some/path so that everything is seperated nicely.

Can anyone point to a good tutorial, or maybe explain here the steps to set this up? I’m a bit new to apache setups.

Are there any advantages / drawbacks to doing it this way? Would a single tomcat instance be better? We need to be able to bring down sites one at a time without influencing each other. Also, our DNS provider prevents us from setting up stealth redirects, so we have to go through apache to have nice URLs rather than redirecting straight to the tomcats.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:08:50+00:00Added an answer on June 1, 2026 at 1:08 pm

    I believe you have 2 questions here:

    1. How to run multiple tomcat instances in the same server and should
      you?
    2. How to configure apache httpd to do virtual host and front
      tomcat?

    For 1. The following is a very good tutorial on how to run multiple tomcat instances in the same server: http://java.dzone.com/articles/running-multiple-tomcat, but should you? the answer is “it depends”. If you have a super powerful box and it is under utilized, you should. It also depends on what type of application you runs for each individual sites. It will definitely help you “bring down sites one at a time without influencing each other”. With apache httpd configuration which I will explain in the next section, you can also run the each site on separate machines (physical or vm).

    For 2. In you case, you just need to configure apache httpd to do virtual host and use ajp to connect to tomcat.

    <VirtualHost *:80>
        ServerName www.oursite.com
    
        ProxyPass / ajp://tomcat.oursite.com:8009/www retry=5
        ProxyPassReverse / ajp://tomcat.oursite.com:8009/www
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerName test.oursite.com
    
        ProxyPass / ajp://tomcat.oursite.com:8010/test retry=5
        ProxyPassReverse / ajp://tomcat.oursite:8010/test
     </VirtualHost>
    

    In the above configuration, you need to configure DNS entries of both http://www.yoursite.com and test.yoursite.com to point to the same host. It also assume you run both your www and test webapps on different tomcat instances on the same host tomcat.oursite.com, one on ajp port 8009 and the other one on ajp port 8010. You can also change it to a different server of its own. It’s very flexible. FYI, following is how to configure ajp in tomcat: http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize that this question has been asked 100times but none that I have
I realize this question has been asked several times, but I wanted to frame
I realize that this type of question has been asked several times before but
While I realize that this question has been asked once or twice ago but
I realize this question has been asked and answered in the past, but I'm
I realise that this question has probably been asked to death, but none of
I realize this question has been asked several times in several different forms ,
I realize this question has been asked dozens of times https://stackoverflow.com/search?q=maxStringContentLength However, I still
I realize this is a basic question but I have searched online, been to
I realize that this is probably a very basic question, but I have spent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.