tomcat6.0 配置不同端口访问不同项目
<?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 配置不同端口访问不同项目的更多相关文章
- nginx配置80端口访问8080+项目名地址
tomcat访问项目,一般是 ip + 端口 + 项目名 nginx 配置 location / {} ,一般只能跳转到 ip + 端口,如果想要直接访问项目,就需要修改tomcat的配置了 如何保证 ...
- 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. ...
- 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 ...
- ubuntu14.10服务器版安装xampp,配置域名端口访问
1.从xampp下载下了xampp-linux-1.7.3a.tar这个包,然后ftp到我的linux虚拟机中, 2.复制到opt下,(可以直接解压的)到opt下面,tar xvfz xampp-li ...
- 如何在Apache中配置多端口访问
环境: Windows server 2008 R2, Apache, PHP5 步骤: 建立一个目录,里面放置一个index.php. 打开Apache\conf\httpd.conf 文件,做如下 ...
- You don't have permission to access / on this server. wampserver3.1.0配置外网访问的问题
参考各种wamp教程后外网仍然不能访问服务器,很是头疼 网上好多wampserver配置都比较久远,最新版本3.1.0的很少,首先打开httpd.conf文件(这部分较简略,详细可以参考其他wamp配 ...
- xampp配置多端口访问
1.修改D:\xampp\apache\conf\extra中的httpd-vhosts.conf文件,在最底部添加 <VirtualHost *:8080> ##需要监听的端口号 Ser ...
- angular4.0配置同时使用localhost和本机IP访问项目
之前写过<angular4.0配置本机IP访问项目>的文章,今天再次更新一个,谢谢大家的指正. 今天的目的是:使用本机IP地址,或者localhost都可以访问项目. 第一步:找到此文件& ...
- Nginx高级配置,同1台机器部署多个tomcat、配置多个域名,每个域名指向某一个tomcat下的项目,共用Nginx80端口访问;
需求说明: 只有一台服务器和一个公网IP,多个项目部署在这台机器上面,且每个项目使用一个单独的域名访问,域名访问时都通过Nginx的80端口访问.(如下图所示) 配置过程: 一.tomcat的serv ...
随机推荐
- 2.纯 CSS 创作一个矩形旋转 loader 特效
原文地址:2.纯 CSS 创作一个矩形旋转 loader 特效 扩展后地址:https://scrimba.com/c/cNJVWUR 扩展地址:https://codepen.io/pen/ HT ...
- js1:根据标签的Id获取value值
例子:<input id="startDate" name="startDate" value="2015-09-14" class= ...
- ADODB 调用存储过程
追加参数法调用存储过程 追加参数通过CreateParameter方法,用来指定属性创建新的Parameter对象.具体语法如下: Set parameter = command.CreatePara ...
- 在Linux下判断系统当前是否开启了超线程
#lscpu Thread(s) per core: 2Core(s) per socket: 6Socket(s): 2 -------------------------------------- ...
- unity WWW加载进度条
using UnityEngine; using System.Collections; public class testProgress : MonoBehaviour { void Start ...
- StringBuild的一个小问题
今天在项目开发的过程中写了一小段代码: sb_result.AppendFormat("{\"SmsmTaskModeName\":\"{0}\",\ ...
- conductor任务域
任务域 任务域有助于支持任务开发.这个想法是相同的“任务定义”可以在不同的“域”中实现.域名开发人员控制的任意名称.因此,当工作流程启动时,调用者可以在工作流中的所有任务中指定哪些任务需要在特定域中运 ...
- Golang 获取MD5的方法
import ( "crypto/md5" "encoding/hex" ) //生成32位md5字串 func Md5(s string) string { ...
- Spring依赖注入:注解注入
注解注入顾名思义就是通过注解来实现注入, Spring和注入相关的常见注解有Autowired.Resource.Qualifier.Service.Controller.Repository.Com ...
- Control(拆点+最大流)
Control http://acm.hdu.edu.cn/showproblem.php?pid=4289 Time Limit: 2000/1000 MS (Java/Others) Mem ...