Do you know the normal methods for hosting multiple web applications on one tomcat?

One of the ways i'm able to think about doing the work is applying different context pathways for that different programs, but which makes the url look ugly for potential clients.

edit: i have to host different programs on one tomcat

The "standard" method of this option would be to front your tomcat instance by having an http server that may proxy either: 1. AJP - A binary protocol tight (therefore faster) than http. 2. Http

So that your virtual sites in apache react to bob.com and proxies to localhost:8080/bob and alice.com to localhost:8080/alice.

Search for mod_proxy mod_proxy_ajp paperwork and you ought to be set.

You will find lots of ways.

  1. Just deploy them on one instance.
  2. Install multiple cases of Tomcat on one server (e.g. required for some programs which require separated JVMs)
  3. create virtual hosts in tomcat and deploy every application as ROOT within an own virtual host

Not to mention you need to front your tomcat by having an apache server. Easiest way could be imho to make use of mod_proxy_ajp.

For multiple instances you are able to take a look here: http://wiki.v-collaborate.com/display/BLOG/2010/12/08/Install+Apache+Tomcat+7+on+ubuntu+and+debian?showComments=true

For that third way there's another publish on my small blog: http://wiki.v-collaborate.com/display/BLOG/2010/12/16/Configure+a+virtual+host+in+Apache+Tomcat+7 A great source can also be: http://confluence.atlassian.com/display/DOC/Guide+to+using+Apache+Tomcat%27s+Virtual+Hosts

Exactly what do you mean by url searching ugly? Anyways you will find 2 deployment models: single-tenant (diff context pathways but simple) and multi-tenant (single context path but complex (though achievable))

You could also have an interest to appear my answer here: Creating a Multitenant SaaS