aspose file tools*
The moose likes Tomcat and the fly likes Virtual Hosting with Tomcat 4.x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Virtual Hosting with Tomcat 4.x " Watch "Virtual Hosting with Tomcat 4.x " New topic
Author

Virtual Hosting with Tomcat 4.x

Josh Batchelor
Greenhorn

Joined: Dec 18, 2001
Posts: 9
I am having a hard time getting this to work. Can anyone point in the right direction to get some help or can help me out. I have added the following entries to my server.xml file, and when I go to those entries they all take me to the root folder.
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">

<Host name="mydomain0.com" debug="0" appBase="webapps" unpackWARs="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="mydomain0." suffix=".log" timestamp="true"/>
<Context path="" docBase="mydomain0" debug="0" reloadable="true"/>
<Context path="/mydomain0" docBase="mydomain0" debug="0" reloadable="true"/>
</Host>
<Host name="mydomain1.com" debug="0" appBase="webapps" unpackWARs="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="mydomain1." suffix=".log" timestamp="true"/>
<Context path="" docBase="mydomain1" debug="0" reloadable="true"/>
<Context path="/mydomain1" docBase="mydomain1" debug="0" reloadable="true"/>
</Host>
<Host name="mydomain2.com" debug="0" appBase="webapps" unpackWARs="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="mydomain2." suffix=".log" timestamp="true"/>
<Context path="" docBase="mydomain2" debug="0" reloadable="true"/>
<Context path="/mydomain2" docBase="mydomain2" debug="0" reloadable="true"/>
</Host>
Sloan Bowman
Ranch Hand

Joined: Jan 21, 2003
Posts: 107
Depending on how you want to setthis up here is an example that should work for you. This is assuming you want to serve a virtual host from /home/host/www. The trick is to specify your context correctly. This example is setup as a virtual host in tomcat 4.1.18 and being served with apache-tomcat using jk. Let me know if you have any questions.
<Host name="host.domain.com" debug="0" appBase="/home/host" unpackWARs="true">
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" pre
fix="host." suffix=".log" timestamp="true"/>
<Context path="" docBase="www" debug="0" reloadable="true">
</Context>
</Host>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Virtual Hosting with Tomcat 4.x
 
Similar Threads
Tomcat Virtual Servers like Apache 2.0 possible?
virtual hosts in stand alone tomcat
Web applications with various configurations files
server.xml - FileLogger and Valve
How to see sessions in my tomcat hosts