Nabarun
Nabarun

Reputation: 791

Context Setting for virtual host in Tomcat 7

I like to access my website [http://www.mysite.com/my-web-site] using [http://www.mysite.com]

I have defined a Host in /conf/server.xml as follows

<Host name="www.mysite.com" appBase="lpsadmin" unpackWARs="true" autoDeploy="true" copyXML="true" />

In my my-web-site.war I have context.xml under META-INF which has the following

<Context path="" docBase="/my-web-site" reloadable="true" allowLinking="true" cacheMaxSize="40960"/>

From Tomcat documentation I know docBase will not be honoured when Host has an appBase. As expected, I get the following warning

WARNING: A docBase /Applications/tomcatstack-7.0.32-0/apache-tomcat/lpsadmin/my-web-site inside the host appBase has been specified, and will be ignored

How do I change my context path when Host has an appBase? I do not prefer ROOT.xml solution.

Upvotes: 0

Views: 1455

Answers (1)

Nabarun
Nabarun

Reputation: 791

I could not find ways to achieve this without ROOT.xml. I have achieved this by placing a httpd in front of Tomcat and added virtual hosts in httpd.

Upvotes: 0

Related Questions