Assigning Static IP to Virtualhost - IP based virtualhosting in Tomcat
by Selva[ Edit ] 2010-01-26 17:18:49
In this scarp i will let you know about how to do IP based virtualhosting in tomcat . This will be usefull if want to assign a static IP to a shared java / jsp / tomcat hosting account . Assume that your virtual hostname is hiox.org and the static IP to be assigned for hiox.org is 192.168.0.12
Step 1 : Edit configuration file
server.xml
Step 2 : In server.xml there will entry like
<Host name="hiox.org" appBase="/home/hioxorg/public_html/webapps">
<Alias>www.hiox.org</Alias>
<Context path="" reloadable="true" docBase="/home/hioxorg/public_html" debug="1"/>
<Context path="/manager" debug="0" privileged="true"
docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
</Context>
</Host>
Change this to :
<Host name="192.168.0.12" appBase="/home/hioxorg/public_html/webapps">
<Alias>hiox.org</Alias>
<Alias>www.hiox.org</Alias>
<Context path="" reloadable="true" docBase="/home/hioxorg/public_html" debug="1"/>
<Context path="/manager" debug="0" privileged="true"
docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
</Context>
</Host>
Step 3 : Restart the tomcat server