Cruisecontrol and Tomcat on port 80?
June 8, 2009 4:19 PM   Subscribe

Server filter: How can I get Cruisecontrol and Tomcat on the same port? (Port 80?)

By default, CruiseControl and Tomcat need to use different ports to run on the same computer. However, the way things are set up for my server, they don't need to run at the same time. So, is it possible to have them both on the same port, but only activated when the user types in a certain link? For example:

http://localhost --> Would lead to Tomcat
http://localhost/cruisecontrol --> Leads to the CruiseControl dashboard.

When CruiseControl is accessed, Tomcat wouldn't be active.

My goal is to get them both running on the same port, but switching off when needed. I was told that this is possible and that it had been done before, but I wasn't given any details. Does anyone have any insight or possible alternatives?
posted by nikkorizz to Technology (6 answers total)
 
Best answer: I think something like this would work.... Run Tomcat and CruiseControl all the time, on dedicated ports, which are not port 80. Then run Apache on port 80, and use mod_proxy (or something like it) to proxy the requests through to the appropriate place depending on the url being requested. The user would still access the pages via http://localhost and http://localhost/cruisecontrol.

A more crude but maybe simpler solution might be to run one on port 80 (say tomcat) and the other on some other port, say 81, then stick in a redirect page and call it http://localhost/cruisecontrol/index.html. That page can then redirect to http://localhost:81/cruisecontrol. The user's browser will then show the new url with the :81 in it. If that's ok with you, I think this second option would be easier to get running.
posted by jclovebrew at 4:52 PM on June 8, 2009


can you use apache and mod_proxy_jk? Then just bind /cruisecontrol to the cruisecontrol instance, and everything else to tomcat - then you can leave them both going at all times.
posted by jenkinsEar at 4:52 PM on June 8, 2009


curse you jclovebrew!
posted by jenkinsEar at 4:52 PM on June 8, 2009


jclovebrew is correct; have your servers bind to ports on localhost and let mod_proxy forward connections to those ports.
posted by rodgerd at 4:57 PM on June 8, 2009


Do you need them both to be running on 'localhost' specifically (e.g. 127.0.0.1) or would running them on two different local addresses (127.0.0.1 vs 127.0.0.2) work for you? Because if that will work then you can bind each of them to separate, different, local IP addresses and they'll both be able to listen on port 80.
posted by FishBike at 4:57 PM on June 8, 2009


Response by poster: They would need to have the same address.

I think jclovebrew is on to something with Apache. I'll have to try it out. Thanks guys!
posted by nikkorizz at 6:03 PM on June 8, 2009


« Older Ayudarme, por favor.   |   How do I turn a text file list of artist &... Newer »
This thread is closed to new comments.