Deploying more than one web-application for a host
by Selva[ Edit ] 2008-09-10 17:22:56
We can have more than one web-application or ( Deploy any number of .war files) for host or virtualhost.This done by just editing
server.xml file and adding a
<Context> element inside the
<Host> element of a host.
Example :
If we want deploy a new web-application (.war file) for a virtualhost
hscripts.com then add the following
<Context> element :
<Context path=/example docBase=/home/hscripts/public_html/eample.war >
Now
<Host> element for hscripts.com will look like
<Host name="hscripts.com" appBase="/home/myscript/public_html/weapps" autoDeploy="true">
<Alias>www.hscripts.com</Alias>
<Context path="" reloadable="true" docBase="/home/myscript/public_html" debug="1"/>
<Context path="/manager" debug="0" privileged="true"
docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
</Context>
<Context path="/example" docBase="/home/hscripts/public_html/eample.war" />
</Host>
Now the new web-application ( example.war) can be accessed by the url:
http:://hscripts.com/example
Likewise we can deploy any number of web-applications.