yac678
asked on
configuring virtual hosts on Tomcat 5.5
I need to configure two virtual hosts on my tomcat server so that I could run two different web applications depending on the domain used. I am following instructions on http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html#Configuring_Your_Contexts
I added the follwoing lines to my server.xml file:
<Host name="crazydeal.co.il" appBase="ROOT" autoDeploy="true"/>
<Host name="www.keywords-4-websites.com" appBase="keywords" autoDeploy="true">
<Alias>keywords-4-websites .com</Alia s>
</Host>
The applications are deployed under webapps/ROOT and webapps/keywords. When I hit either URL in the browser I don't get anything from tomcat (i.e. a blank page). Both URLs worked fine previously, that is before I added the virtual hosts definition - the keywords application had the context "keywords" so it did not colide with the other application. I now removed the context and now both applications will have conflicting pages unless I use virtual hosts. Any idea what is going on?
I added the follwoing lines to my server.xml file:
<Host name="crazydeal.co.il" appBase="ROOT" autoDeploy="true"/>
<Host name="www.keywords-4-websites.com" appBase="keywords" autoDeploy="true">
<Alias>keywords-4-websites
</Host>
The applications are deployed under webapps/ROOT and webapps/keywords. When I hit either URL in the browser I don't get anything from tomcat (i.e. a blank page). Both URLs worked fine previously, that is before I added the virtual hosts definition - the keywords application had the context "keywords" so it did not colide with the other application. I now removed the context and now both applications will have conflicting pages unless I use virtual hosts. Any idea what is going on?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
testez,
Forget my previous comment. Your solution worked!
Forget my previous comment. Your solution worked!
ASKER
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
...
</Host>
so wouldn't it be problematic to have appBase="webapps" as you mentioned? Or should I removed the default host?