Multiple host names with TomCat?

Issues and Questions related to running Apache Tomcat on z/OS
Post Reply
TimHare
Posts: 6
Joined: Mon Jan 25, 2010 10:31 am
Location: Tallahassee, FL

Multiple host names with TomCat?

Post by TimHare » Mon Jan 25, 2010 10:39 am

Using a third party product (IBI's WebFOCUS), and now moving to servlets under TomCat in addition to CGI under IBM HTTP Server (IMWHTTPD). Under IHS, I used multiple host name support so that I had URLs like hostname, hostnamet for test, hostnamez for a special test environment, etc. One web server listened on port 80 and used URL mapping with host name to select appropriate directories. Once the 'test' directory was selected, for example, the config files used by the CGI scripts came from there.

I have several questions:

1. Can I deploy contexts for multiple host names - with the same context name for different hosts mapping to different instances of a .war file, or do I need to run separate TomCat servers for each host name
2. If separate servers, can I make one hostname specific so it won't handle contexts other than that hostname (it's important to prevent typos in a programmer's code from sloshing his work over into production before it's ready)
3. It seems to me TomCat could also do the same services the Web Server is doing (serving static pages, possibly running CGI) is this true?

dovetail
Site Admin
Posts: 1781
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail » Mon Jan 25, 2010 3:13 pm

Tim,

I'll try to answer your questions, but you may also want to ask on the tomcat-users mailing list, where you can probably get more information.

You can have multiple <Hosts/> (virtual hosts) connected to the same <Engine/>. I don't know if you can have two different "contexts" (web applications) only distinguished by a different virtual host. Also, normally to have two different contexts with the same war you have to make a copy of that war with a different name (but maybe a symlink would work?).

Since this is to segregate test from production, I would opt to have to separate Tomcat instances, since there are other reasons that you might want to separate the jobs. (Different RACF security rules, different WLM goals, different availability, etc etc).

Tomcat will serve static pages just fine, and I believe will support GCIs, but it may not do this as well as a really HTTP server.

If it were me, I would look at running Apache (which is available with IBM Ported Tools) as a proxy front end to multiple Tomcats.

TimHare
Posts: 6
Joined: Mon Jan 25, 2010 10:31 am
Location: Tallahassee, FL

Thanks

Post by TimHare » Tue Jan 26, 2010 4:19 pm

I will look into the Apache server but right now I just need to get servlets running for this product, I think.

Post Reply