Tomcat virtual host
This mini howto to show how to configure a virtual host on tomcat.
This use HTTP 1.1 feature so with one single IP and one single Tomcat server you can virtually host infinite domains.
Edit the file %TOMCAT_HOME%/conf/server.xml
Under the tag host (the one setted by default for localhost) add the following line:
1 2 3 |
<host name="[www.mydomain.com]"> <context path="/" docBase="webapps/[mydomainwebsite]" debug="0" reloadable="true"/> </host> |
Obviously you have to change change the [squared] value respectively with the domain of the site and with the directory where there are the web application files.
Errata:
apparently one of 2 sites doesn’t work with the settings above. A working version look like this:
1 2 3 |
<host name="www.blu-blu.info" appBase="webapps/blublu" unpackWARs="true" autoDeploy="true"> <context path="" docBase="" debug="0" reloadable="true" /> </host> |