Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm working on a couple small/medium projects, but I do like tinkering with tools and I have to admit I do love overcomplicating things. The projects that I am working on are Java web applications that I have up until now deployed in a single Tomcat instance on a single server. My build tool of choice is Maven, source control; SVN, and I've got a Hudson and Bamboo CI server running.

Now, I'd like to have 3 "environments" if you will, that I will deploy my WARs to. I was thinking of having one for development builds (deployed on-demand via Hudson or nightly builds), QA to get feedback from friends, and production that I will hook up to my live domains.

How would I go about achieving this with Tomcat? I was thinking of running 3 different instances of Tomcat, with different priorities and memory pools assigned so that production would run smoothly but how exactly would I do that -- create 3 run scripts (I want one "webapps" directory for each)?

I've got an 8-core Xeon with 8 GB RAM at my disposal and I do think it is sufficient for now, however, I am probably going to end up with using another server for production later on ;-). The box is running Gentoo. I also do not mind alternatives containers such as Resin being suggested.

Thanks in advance.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You got the idea. Use three tomcats and apache with mod_proxy_ajp in front of them for nice looking host names or even different domains.

Download tomcat from apache, and create 3 copies of the unpacked directory (I use /opt for this). Change ports in server.xml of two of them, add startup scripts (in case you need a reboot) and configure apache to serve all 3 from vhosts.

Additionally, you can use different jdk versions (for tests) downloading, unpacking and changing environment variables in tocmat scripts.

HTH

share|improve this answer
    
Thanks for the reply Paul. I've currently got Tomcat-6 installed from source via Portage on Gentoo. It would be great if I could re-use the binary directory three times. I'll see if i can make that happen. –  John Nov 13 '10 at 12:05
    
If you cannot copy it, you can download it from tomcat.apache.org and untar it to a dedicated folder. –  Paul Nov 13 '10 at 12:39
add comment

Your Answer

 
discard

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.