Tomcat supports "Virtual hosting", where you can direct several domain names to the same server computer / instance of Tomcat, and it will serve different content depending on which server you have asked even though they're on the same computer.
Here is the important part of the
server.xml file that I used to set up an example yesterday afternoon:
<Engine name="Catalina" defaultHost="easterton">
<Host name="easterton" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="westerton" appBase="webapps2"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
This Tomcat is serving a domain called "easterton" from the
webapps folder, and a domain called "westerton" from the
webapps2 folder. The domain names need to be correctly resolved by the browsing system (which will happen if you're using DNS, or if you set it in their /etc/hosts file). If the server receives an request for an unrecognised host, it defaults to "easterton".
Although I'm showing you virtual hosting on Apache Tomcat in thsi example, it's far more commonly used on Apache httpd - indeed, you'll probably find that more domains worldwide are served via a virtual host setup than via single computer hosting.
See the full Tomcat configuration file I was using
here. For details of our Tomcat deployment courses, see
here, and for Apache httpd see
here (written 2008-11-22 01:52:12)
Associated topics are indexed under
A656 - Web Application Deployment - More Tomcat ConfigurationA900 - Web Application Deployment - Tomcat - Extra Features
Some other Articles
daemons - what is running on my Linux server?sstrwxrwxrwx - Unix and Linux file permissionsXML, HTML, XHTML and moreTable TopicsVirtual Hosting under Tomcat - an exampleEvery cloud has a silver liningKeeping on an even keelVirtual Hosts and Virtual ServersComparison - with and without flashShopping in Melksham