in $CATALINA_BASE/conf/server.xml merge these settings:

<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps"
     unpackWARs="true" autoDeploy="true"
     xmlValidation="false" xmlNamespaceAware="false">

 <Alias>foo.com</Alias>
</Host>

<Host name="file1.foo.com" appBase="/opt/file1.foo.com/tomcat/webapps"
      workDir="/opt/file1.foo.com/tomcat/work"
      unpackWARs="true" autoDeploy="true>
      xmlValidation="false" xmlNamespaceAware="false">

 <!-- Rename your file1.war to /opt/file1.foo.com/tomcat/webapps/ROOT.war and 
ensure it does not contain any META-INF/context.xml file -->
</Host>

<Host name="file2.foo.com" appBase="/opt/file2.foo.com/tomcat/webapps"
      workDir="/opt/file2.foo.com/tomcat/work"
      unpackWARs="true" autoDeploy="true>
      xmlValidation="false" xmlNamespaceAware="false">

 <!-- Rename your file2.war to /opt/file2.foo.com/tomcat/webapps/ROOT.war and 
ensure it does not contain any META-INF/context.xml file -->
</Host>

<Host name="file3.foo.com" appBase="/opt/file3.foo.com/tomcat/webapps"
      workDir="/opt/file3.foo.com/tomcat/work"
      unpackWARs="true" autoDeploy="true>
      xmlValidation="false" xmlNamespaceAware="false">

 <!-- Rename your file3.war to /opt/file3.foo.com/tomcat/webapps/ROOT.war and 
ensure it does not contain any META-INF/context.xml file -->
</Host>
</Engine>


Ensure the 3 sets of "webapps" and "work" directories are writable by the userid your JVM is running as.


Mahesh S Kudva wrote:

I have setup Tomcat+Apache2+mod_jk. I have 3 application in war files namely flie1.war, file2.war and file3.war. To deploy, I just put them in the deploy folder and access then using the urls:
http://foo.com/file1
http://foo.com/file2
http://foo.com/file3
This works perfectly for me. I want to change this to simple urls as follows:
http://file1.foo.com
http://file2.foo.com
http://file3.foo.com

I have also read the notes on Virtual hosting: http://jakarta.apache.org/tomcat/connectors-doc-
archive/jk2/jk2/vhosthowto.html

Even though I am not able to configure Tomcat to connect to the war files as requested. How do I configure tomcat to connect to the correct war file as requested?

Any help will be appreciated.


--
Darryl L. Miles



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to