原先配置在TOMCAT里面的3个程序可以实现的多域名.现在追加了几个程序也一样的配置,却只能访问到登陆的界面(输入用户明和密码哪个界面),当把用户名和密码输入进去点登陆后就跳出了.HTTP Status 500 - 和HTTP Status 400 - 的报错页面.程序的内容我放在C:\Program Files\Java\Tomcat 5.5\程序的名称\ROOT里面.
server.xml的配置是
<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other --><!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port. Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
--><Server port="8005" shutdown="SHUTDOWN"> <!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
<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"/> <!-- Global JNDI resources -->
<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="80" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" /> <Engine name="Catalina" defaultHost="office2.zjmc.net.cn"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="office2.zjmc.net.cn" appBase="office"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="zf.zjmc.net.cn" appBase="zfoa"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="hrm.zjmc.net.cn" appBase="hrm"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="zjmcyp.zjmc.net.cn" appBase="zjmcyp"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" />
</Engine> </Service></Server>其中office2.zjmc.net.cn和hrm.zjmc.net.cn和zjmcyp.zjmc.net.cn都可以访问并登陆的.zf.zjmc.net.cn的域名却不成.我换了好几个程序都不成.不知道什么原因.还是因为我conf.xml的配置问题.
server.xml的配置是
<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other --><!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port. Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
--><Server port="8005" shutdown="SHUTDOWN"> <!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
<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"/> <!-- Global JNDI resources -->
<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="80" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" /> <Engine name="Catalina" defaultHost="office2.zjmc.net.cn"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="office2.zjmc.net.cn" appBase="office"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="zf.zjmc.net.cn" appBase="zfoa"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="hrm.zjmc.net.cn" appBase="hrm"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="zjmcyp.zjmc.net.cn" appBase="zjmcyp"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" />
</Engine> </Service></Server>其中office2.zjmc.net.cn和hrm.zjmc.net.cn和zjmcyp.zjmc.net.cn都可以访问并登陆的.zf.zjmc.net.cn的域名却不成.我换了好几个程序都不成.不知道什么原因.还是因为我conf.xml的配置问题.
--------------------------------------------------------------------------------Apache Tomcat/5.5.17这个是什么意思~
appbase最好用绝对路径<------------------------------------>
JAVA免费论坛http://www.jsprun.net