<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="" shutdown="SHUTDOWN"> <!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<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> <!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
--> <Service name="Catalina"> <Connector port="" protocol="HTTP/1.1"
connectionTimeout=""
redirectPort="" /> <Connector port="" protocol="AJP/1.3" redirectPort="" /> <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>

以上是默认Server.xml配置,默认项目物理路径:webapps/ROOT/

访问地址类型:http://localhost/

下面要增加一下带端口访问的项目例如:http://localhost:8088/,物理路径:webapps1/ROOT/

步骤:

1、增加一个Service节点,(直接复制原Service节点即可)

2、修改新Service 节点中所有名称Catalina 修改为Catalina1(2处)

3、复制一份conf下的Catalina文件夹 并命名为Catalina1

4、修改新创建Service下Host节点的appBase属性对应物理路径webapps1

5、在新创建Service下Host节点下增加节点以下节点:( docBase 指向新项目物理路径)

<Context  path="/pm25" reloadable="true" docBase="D:\\Tomcat\\webapps1\\ROOT"/>
          

新节点配置如下:

 <Service name="Catalina1">

        <Connector port="" protocol="HTTP/1.1"
connectionTimeout=""
redirectPort="" /> <Connector port="" protocol="AJP/1.3" redirectPort="" /> <Engine name="Catalina1" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/> <Host name="localhost" appBase="webapps1"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/pm25" reloadable="true" docBase="D:\\Tomcat\\webapps1\\ROOT"/>
</Host> </Engine>
</Service>

完整配置如下:

<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="" shutdown="SHUTDOWN"> <!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<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> <!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
--> <Service name="Catalina"> <Connector port="" protocol="HTTP/1.1"
connectionTimeout=""
redirectPort="" /> <Connector port="" protocol="AJP/1.3" redirectPort="" /> <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>
<Service name="Catalina1"> <Connector port="8088" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" /> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <Engine name="Catalina1" defaultHost="localhost"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/> <Host name="localhost" appBase="webapps1"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="/pm25" reloadable="true" docBase="D:\\Tomcat\\webapps1\\ROOT"/>
</Host> </Engine>
</Service> </Server>

tomcat6.0 配置不同端口访问不同项目的更多相关文章

  1. nginx配置80端口访问8080+项目名地址

    tomcat访问项目,一般是 ip + 端口 + 项目名 nginx 配置 location / {} ,一般只能跳转到 ip + 端口,如果想要直接访问项目,就需要修改tomcat的配置了 如何保证 ...

  2. vue2项目 :在hosts里面配置了装逼的模式。设置应用在127.0.0.1:80端口访问; 并将127.0.0.1指向www.yours.com ;问题“ Invalid Host header”

    转自博客:https://www.cnblogs.com/cynthia-wuqian/p/8575401.html 1.MAC设置应用在127.0.0.1:80端口访问: config/index. ...

  3. vue2.5.2版本 :MAC设置应用在127.0.0.1:80端口访问; 并将127.0.0.1指向www.yours.com ;问题“ Invalid Host header”

    0.设置自己的host文件,将127.0.0.1指向自己想要访问的域名 127.0.0.1 www.yours.com 1.MAC设置应用在127.0.0.1:80端口访问: config/index ...

  4. ubuntu14.10服务器版安装xampp,配置域名端口访问

    1.从xampp下载下了xampp-linux-1.7.3a.tar这个包,然后ftp到我的linux虚拟机中, 2.复制到opt下,(可以直接解压的)到opt下面,tar xvfz xampp-li ...

  5. 如何在Apache中配置多端口访问

    环境: Windows server 2008 R2, Apache, PHP5 步骤: 建立一个目录,里面放置一个index.php. 打开Apache\conf\httpd.conf 文件,做如下 ...

  6. You don't have permission to access / on this server. wampserver3.1.0配置外网访问的问题

    参考各种wamp教程后外网仍然不能访问服务器,很是头疼 网上好多wampserver配置都比较久远,最新版本3.1.0的很少,首先打开httpd.conf文件(这部分较简略,详细可以参考其他wamp配 ...

  7. xampp配置多端口访问

    1.修改D:\xampp\apache\conf\extra中的httpd-vhosts.conf文件,在最底部添加 <VirtualHost *:8080> ##需要监听的端口号 Ser ...

  8. angular4.0配置同时使用localhost和本机IP访问项目

    之前写过<angular4.0配置本机IP访问项目>的文章,今天再次更新一个,谢谢大家的指正. 今天的目的是:使用本机IP地址,或者localhost都可以访问项目. 第一步:找到此文件& ...

  9. Nginx高级配置,同1台机器部署多个tomcat、配置多个域名,每个域名指向某一个tomcat下的项目,共用Nginx80端口访问;

    需求说明: 只有一台服务器和一个公网IP,多个项目部署在这台机器上面,且每个项目使用一个单独的域名访问,域名访问时都通过Nginx的80端口访问.(如下图所示) 配置过程: 一.tomcat的serv ...

随机推荐

  1. 最近玩的centos7.3用的防火墙转载

    CentOS 7 firewalld使用简介 1.firewalld简介 firewalld是centos7的一大特性,最大的好处有两个:支持动态更新,不用重启服务:第二个就是加入了防火墙的“zone ...

  2. rabbitMQ 的基本知识

    参考:  https://www.cnblogs.com/dwlsxj/p/RabbitMQ.html

  3. UI5-文档-2.3-使用SAPUI5工具为Eclipse开发应用程序

    用于为简单用例开发应用程序.用于Eclipse的SAPUI5应用程序开发工具提供向导来支持您以一种简单的方式创建应用程序.使用application project向导,将自动创建包含视图和控制器的必 ...

  4. eclipse 使用tomcat7.0建立Dynamic Web Project 时 web.xml的问题

    最近使用Eclipse helios版本结合tomcat7.0建立动态的web项目时,发现在WEB-INF下的web.xml没有了. 解决方案: 建立web项目时,建到第三个下一步时,将 Genera ...

  5. jquery clone 获取文本框值得问题

    1 clone 出来的文本框 默认不会把原来的事件也带过去 如果使用 $("#").clone(true);   true  可以将原来的事件带过去 获取文本框的值 可以使用事件 ...

  6. docker-composer

    1.安装docker-composer   参考官方 安装1.20.1 sudo curl -L https://github.com/docker/compose/releases/download ...

  7. Fb 第三方接口

    1.Facebook ID? User ID / https://www.piliapp.com/facebook/id/?url=https%3A%2F%2Fwww.facebook.com%2Fz ...

  8. 上传 第三方jar包 nexus

    手动上传第三方jar包到nexus的步奏: 1)按下图方式进行 2)按下图完成上传 3)点击保存完成

  9. SQL查询效率where语句条件

    有索引的列优先,都有索引的看查询出来的数据量,少的优先 in ,not in,<>,is null,is not null 等由于不会走索引,尽量不要使用. WHERE子句后面的条件顺序对 ...

  10. selenium常用的断言

    断言: 验证应用程序的状态是否同期望的一致,常见的断言包括验证页面内容,如标题是否与预期一致,当前的位置是否正确等等 断言常被用的4种模式+5种手段:Assert 断言失败的时候,该测试终止 veri ...