Deploying more than one web-application for a host - Tomcat Views : 780
Tagged in : Tomcat
0 0
Send mail
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.
By Selva, On - 2008-09-10



    Login to add Comments .