新加的虚拟主机和虚拟目录就是不能共存,
若在默认的LOCALHOST下增加一个虚拟路径是OK的
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/aaa" docBase="e:/www" debug="0" crosscontext="true" reloadable="true" />
.........
新增加的虚拟主机这样配置的话只能访问虚拟主机,访问www.a.com:8080 就 OK
<Host name="www.a.com" debug="0" appBase="E:\a" >
<Context path="" docBase="." debug="0" reloadable="true" crossContext="true" /></Host>若改成 访问www.a.com:8080/bbb 就 OK , 访问www.a.com:8080就找不到页面
<Host name="www.a.com" debug="0" appBase="E:\a" >
<Context path="/bbb" docBase="E:\bbb" debug="0" reloadable="true" crossContext="true" /></Host>搞了很久解决不掉!~求高人!
若在默认的LOCALHOST下增加一个虚拟路径是OK的
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/aaa" docBase="e:/www" debug="0" crosscontext="true" reloadable="true" />
.........
新增加的虚拟主机这样配置的话只能访问虚拟主机,访问www.a.com:8080 就 OK
<Host name="www.a.com" debug="0" appBase="E:\a" >
<Context path="" docBase="." debug="0" reloadable="true" crossContext="true" /></Host>若改成 访问www.a.com:8080/bbb 就 OK , 访问www.a.com:8080就找不到页面
<Host name="www.a.com" debug="0" appBase="E:\a" >
<Context path="/bbb" docBase="E:\bbb" debug="0" reloadable="true" crossContext="true" /></Host>搞了很久解决不掉!~求高人!
解决方案 »
- struts2标签、OGNL和EL怎么取属性值包含"."号的值?
- 请教Hibernate高手: Hibernate Projection 投影问题
- ibatis和hibernate
- org.apache.jasper.JasperException
- Spring2.5 的testContext也不支持Hibernate 的lazy吗??
- ajaxtags框架报错-----java.lang.noclassdefounderror
- 要开发一个自来水收费系统,用什么技术比较好?解答则均有分
- ****&&&用过cloudscape数据库的请进来,难以解决的问题!解决了立刻给分!
- jdom创建xml文件的时候,如何设置xml文件的encoding?
- dubbo kryo 序列化问题,在线等。。。急,各位大神进来帮忙看看,谢谢了。
- List的函数subList()方法返回值问题
- 有关struts2中Action的一些问题,未看者必看
是不是应该两行都配置:<Host name="www.a.com" debug="0" appBase="E:\a" >
<Context path="" docBase="." debug="0" reloadable="true" crossContext="true" />
<Context path="/bbb" docBase="E:\bbb" debug="0" reloadable="true" crossContext="true" />
</Host>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<GlobalNamingResources>
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<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" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" /> <!--
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
--> <!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" acceptCount="100" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority"
connectionName="test" connectionPassword="test"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
connectionName="scott" connectionPassword="tiger"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
--> <!--
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:CATALINA"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
--> <!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/aaa" docBase="e:/www" debug="0" crosscontext="true" reloadable="true" />
<!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true"
notifyListenersOnReplication="true"> <Membership
className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4"
mcastPort="45564"
mcastFrequency="500"
mcastDropTime="3000"/> <Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto"
tcpListenPort="4001"
tcpSelectorTimeout="100"
tcpThreadCount="6"/> <Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled"
ackTimeout="15000"/> <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
<Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
</Cluster>
-->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<!--
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
--> </Host> <Host name="www.a.com" debug="0" appBase="E:\a" unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="." debug="0" reloadable="true" crossContext="true" /></Host>
<Context path="/bbb" docBase="E:\bbb" debug="0" reloadable="true" crossContext="true" />
<Host name="www.b.com" debug="0" appBase="E:\b">
<Context path="" docBase="." debug="0"/>
</Host>
</Engine> </Service></Server>
再确认一个问题,你所说的www.a.com:8080/bbb找不到页面,
你有没有试着直接访问下面的文件,
比如,你在 E:\bbb 目录下随便建立一个 a.htm空文件,访问:http://www.a.com/8080/bbb/a.htm试试?