我是靠谱客的博主 长情大门,最近开发中收集的这篇文章主要介绍tomcat同一个端口同一个域名发布两个项目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">
  
    <!--默认80端口-->
    <Connector port="80" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    


    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <Engine name="Catalina" defaultHost="localhost">


      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

//配置的第一个网站项目,访问网站www.xhhnxx.org即可,由于配的是80端口,所以不用加端口号
      <Host name="www.xhhnxx.org" debug="0" appBase=""
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="F:tomcatapache-tomcat-6.0.20webappsxhhn"                                                 reloadable="true"></Context>
<Context path="/xhhnoa" docBase="F:tomcatapache-tomcat-6.0.20webappsxhhnoa"                                                 reloadable="true"></Context>
        

//配置的第二个项目,访问方法www.whhn.org/xhhnoa即可,注意host name 写localhost。
      </Host>
<Host name="localhost"  appBase=""
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="F:tomcatapache-tomcat-6.0.20webappsxhhnoaxx"                                                 reloadable="true"></Context>
       
      </Host>
    </Engine>
  </Service>
</Server>

最后

以上就是长情大门为你收集整理的tomcat同一个端口同一个域名发布两个项目server.xml的配置代码的全部内容,希望文章能够帮你解决tomcat同一个端口同一个域名发布两个项目server.xml的配置代码所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(58)

评论列表共有 0 条评论

立即
投稿
返回
顶部