Below is a setup according according to tutorial
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
I plan to setup 2 virtual host ie :
1. ren
2. stimpy
( Please refer to the link above for more detail )
Both Virtual Host No War file. Both of them only have the index.jsp ( The
tomcat index file ).
stimpy project is duplicate of ren project.
I just want to try how the virtual host work.
Before Start configuration:
server.xml
=============================================================
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="conf/localhost.jks"
keystorePass="password"
SSLCertificateFile="conf/localhost.crt"
clientAuth="false" sslProtocol="TLS" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
</Service>
</Server>
===============================================================
After Change
server.xml
===============================================================
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="conf/localhost.jks"
keystorePass="password"
SSLCertificateFile="conf/localhost.crt"
clientAuth="false" sslProtocol="TLS" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="ren">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="ren" appBase="renapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="stimpy" appBase="stimpyapps" />
</Engine>
</Service>
</Server>
=============================================================
[IMG]http://i861.photobucket.com/albums/ab175/fsloke/virtualhost.jpg[/IMG]
For context.xml I follow approach 1.
=====================================================
<Context crossContext="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
=====================================================
web.xml content:
=====================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
</web-app>
======================================================
The Filestructure as below:
[IMG]http://i861.photobucket.com/albums/ab175/fsloke/virtualhost2.jpg[/IMG]
Everything I had done through the tutorial.
Now I start run the Tomcat.
Browser: http://ren:8080/
[IMG]http://i861.photobucket.com/albums/ab175/fsloke/pagenoFound.jpg[/IMG]
Server not found
May I know what problem?
I already follow exactly the tutorial but can't works according.
Can anyone tell me what I had did wrong?
-fsloke
--
View this message in context:
http://old.nabble.com/Problem-encounter-during-setup-Virtual-Hosting-and-Tomcat-6.0-tp26357315p26357315.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]