This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weird result of server.xml for Virtual Host

 
Chriz Yuen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. http://mainhost/ >> at IP-a
2. http://virtualhost/ >> at same IP as above.

It is strange that http://mainhost/virtualhost/ could be display as case 2.
Even virtualhost is not subfolder of mainhost.
Below is my server.xml.

<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Service name="Tomcat-Standalone">
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="443" minProcessors="5" maxProcessors="75" enableLookups="true"
acceptCount="10" debug="0" scheme="https" secure="true">
<Factory className="org.apache.catalina.net.SSLServerSocketFactory"
clientAuth="false" protocol="TLS" keystorePass="xxxx"/>
</Connector>
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="80" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="60000"> </Connector>
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
<Engine name="Standalone" defaultHost="mainhost" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<Realm className="org.apache.catalina.realm.MemoryRealm" />
<Host name="mainhost" debug="0" appBase="webapps" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="mainhost_access_log." suffix=".txt" pattern="common"$
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="mainhost_log." suffix=".txt"
timestamp="true"/>
<Context path="" docBase="mainhost" debug="0"/>
</Host>
<Host name="virtualhost" debug="0" appBase="webapps" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="virtualhost_access_log." suffix=".txt" pattern="$
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="virtualhost_log." suffix=".txt" timestamp="true"/>
<Context path="" docBase="virtualhost" debug="0"/>
</Host>
</Engine>
</Service>
</Server>
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would try giving a complete absolute path for the appBase parameter.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic