- 浏览: 887957 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (466)
- iPhone, iOS , Objective-c (155)
- 数据库 (20)
- 设计模式 (5)
- 第三方包管理,cocoapod (2)
- 版本管理, SVN, Subversion, Git (1)
- Google, Android, Java (14)
- Wordpress (1)
- 职业素养 (3)
- 版本管理,git (3)
- 前端小技巧 (2)
- flash (1)
- javascript (5)
- Ruby (0)
- 编程语言 (1)
- 网络常识 (1)
- 找到生活好感觉 (5)
- 产品经理 (1)
- markdown (1)
- 云服务器 (1)
- iPhone (116)
- iOS (116)
- Objective-c (116)
- 学习技巧 (2)
- Google (5)
- Android (6)
- Java (21)
- python (1)
- sqlite (3)
- node.js (2)
- mongodb (2)
- 学习技巧,阅读 (2)
- 软件测试 (3)
- 架构设计 (2)
- 设计 (1)
- Spring framework (3)
- junit (1)
- Linux (2)
- 软件 (1)
- Struts2 (1)
- 版本管理 (3)
- SVN (3)
- Subversion (3)
- Git (3)
- mysql (5)
- quartz (1)
- 无关技术 (1)
- 前端 (1)
- Redis (1)
- 产品管理 (0)
- 计算机常识 (1)
- 计算机科学 (0)
- swift (1)
- 服务器 (2)
- 搜索 (1)
- Scala (1)
- J2EE (1)
- maven (1)
- 前端css (1)
- 英语 (1)
- 消息队列 (1)
- kafka (0)
- apache kafka (4)
- netbeans (1)
- IDE (2)
- 歌词 (1)
- 过滤器实现 (1)
- linux vim vi (1)
- jmeter (1)
- springcloud (1)
最新评论
-
hujingnemo:
不知道为什么打不开
CHM如何改编字体大小 -
weiboyuan:
求答案 weiboyuanios@163.com
iOS软件工程师面试题(高级) -
xueji5368:
这个现在已经广泛使用了嘛!
RoboGuice入门 -
Yao__Shun__Yu:
...
CHM如何改编字体大小 -
353144886:
非常之详细 美女求认识
sqlite数据类型 datetime处理
If you want Tomcat to listen to multiple ports, you need to setup a connector for each port. To get each port mapped to a different application, you need need to wrap each connector in a service and create a host with it's own appBase.
Example of service definition in server.xml:
<Service name="foo">
<Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol" />
<Engine name="Catalina80" defaultHost="localhost">
<Host name="localhost" appBase="foo" unpackWARs="true" autoDeploy="true" />
</Engine>
</Service>
<Service name="bar">
<Connector port="81" protocol="org.apache.coyote.http11.Http11NioProtocol" />
<Engine name="Catalina81" defaultHost="localhost">
<Host name="localhost" appBase="bar" unpackWARs="true" autoDeploy="true" />
</Engine>
</Service>
Instead of dropping the war files in the webapps directory, you need to create the directory foo for port 80 and bar for port 81. Name both war files ROOT.war and drop them in their own base directory. You can of course have multiple apps in each directory if you need.
The directory defined in appBase is relative to the tomcat directory. By using an absolute path, it could be anywhere on your system. From the documentation:
appBase
The Application Base directory for this virtual host. This is the pathname of a directory that may contain web applications to be deployed on this virtual host. You may specify an absolute pathname, or a pathname that is relative to the $CATALINA_BASE directory. [...] If not specified, the default of webapps will be used.
Another option is to keep the default tomcat configuration and use another http server (apache, nginx, lighttpd,...) to map a port to the internal path of a tomcat application.
The root application won't receive requests that match other applications, e.g. /foo/example will go to foo.war, /example/example will go to ROOT.war.
Example of service definition in server.xml:
<Service name="foo">
<Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol" />
<Engine name="Catalina80" defaultHost="localhost">
<Host name="localhost" appBase="foo" unpackWARs="true" autoDeploy="true" />
</Engine>
</Service>
<Service name="bar">
<Connector port="81" protocol="org.apache.coyote.http11.Http11NioProtocol" />
<Engine name="Catalina81" defaultHost="localhost">
<Host name="localhost" appBase="bar" unpackWARs="true" autoDeploy="true" />
</Engine>
</Service>
Instead of dropping the war files in the webapps directory, you need to create the directory foo for port 80 and bar for port 81. Name both war files ROOT.war and drop them in their own base directory. You can of course have multiple apps in each directory if you need.
The directory defined in appBase is relative to the tomcat directory. By using an absolute path, it could be anywhere on your system. From the documentation:
appBase
The Application Base directory for this virtual host. This is the pathname of a directory that may contain web applications to be deployed on this virtual host. You may specify an absolute pathname, or a pathname that is relative to the $CATALINA_BASE directory. [...] If not specified, the default of webapps will be used.
Another option is to keep the default tomcat configuration and use another http server (apache, nginx, lighttpd,...) to map a port to the internal path of a tomcat application.
The root application won't receive requests that match other applications, e.g. /foo/example will go to foo.war, /example/example will go to ROOT.war.
发表评论
-
Java的getResourceAsStream
2017-08-09 14:25 405原理是与类加载器相关 类加载器原理请参考:http://www ... -
java线程池分类及应用
2017-07-20 13:40 5791. 为什么使用线程池 诸如 Web 服务器、数据库服务器、文 ... -
Integer值传递
2017-06-15 18:24 378Java本身都是值传递式的调用,对于对象传递的是地址值。给地址 ... -
Map遍历k,v
2017-06-14 12:01 304发现还Map接口中还有一个Entry<K,V>的接 ... -
使用entrySet遍历Map类集合KV,而不是keySet方式进行遍历
2017-02-08 11:04 849说明:keySet其实是遍历了2次,一次是转为Iterator ... -
并发下remove集合元素要注意的事情
2017-02-08 10:54 11801.不要在foreach循环里进行元素的remove/add操 ... -
Java原始类型转换
2016-08-15 16:25 443要获取获取对象示例 Int Integer i=myInt. ... -
Map转字符串最高效方法
2016-08-09 16:29 2523想做的事情是将一个Map类转成具体和字符串用&隔开,但 ... -
java昨天今天判断
2016-07-01 12:07 443Calendar toda ... -
按key排序
2016-03-04 16:50 442import java.util.Comparator; i ... -
Chrome浏览器查看HTTP header
2016-01-19 17:04 1700使用chrome浏览器自带的开发者工具查看http头的方法 1 ... -
JDBC步骤
2015-08-19 15:38 488JDBC连接数据库 •创建一个以JDBC连接数据库的程序 ... -
java与javascript排序回调的不同之处
2015-07-14 22:27 439Arrays.sort(values,new Comparat ... -
@Resource(type注入失败
2015-06-03 10:45 866不断的去找资料,换方法,最后发现是因为注入的service写了 ... -
eclipse常用快捷键
2015-06-01 17:12 555找出选中方法 使用 Ctrl + Shift + G -
java.util.ConcurrentModificationException 解决办法
2015-05-28 17:16 322在使用iterator.hasNext()操作迭代器的时候,如 ... -
macbook JAVA_HOME设置
2015-05-20 12:34 624搞了半个小时,相当蛋疼 因为在.bash_profile和pr ... -
Java企业设计模式
2014-10-23 20:20 0客户端表达层 为最终用户提供用户界面,例如Web浏览器。 ... -
eclipse 程序调试
2014-08-07 22:34 572http://www.56.com/u35/v_MTAyMj ... -
iBatis加锁
2014-07-10 17:48 819ibatis有事务处理,它有代理类SqlMapExecutor ...
相关推荐
Tomcat7部署多个Web项目的方法-有图有真相,不下你后悔。
在tomcat下部署多个项目,在本例中实现同一端口号的多个项目部署
在tomcat上面不部署多个项目,各种方法详细介绍,详细操作,不同方法的对比和分析,结合eclipse使用。
一个tomcat部署多个项目并通过不同的端口访问
一个Tomcat如何部署多个项目附多种解决方案及详细步骤.docx
同时部署多个Tomcat,同时部署多个Tomcat,同时部署多个Tomcat,同时部署多个Tomcat,同时部署多个Tomcat
里面是一个8.5的tomcat,在对应的webapps下部署了,我写的两个简单的web页面,用于测试一个tomcat配置多个端口运行多个项目。
tomcat部署多个项目.pdf
部署是这个团队用于安装一...也有一种工具被称为Client Deployer, 它是一种基于脚本的“命令shell”,它与这个Tomcat Manager 交互,但是提供另外的一些功能,像编译和验证Web应用程序还有打包Web应用程序到一个WAR文件
NULL 博文链接:https://ourteam.iteye.com/blog/1534974
于JAVA开发项目 随着服务的越来越多 配置文件更是眼花缭乱 每次不知道因为配置问题浪费多少时间 更不知道因为配置问题出过多少问题 多台服务器来回切换 如果服务需要依赖 启动更是问题 功能:一次修改 统一安装;...
tomcat部署war项目的一般操作,从打包,上传,启动项目,查看日志,备份war包,入门操作教程。
linux系统下可以实现多个tomcat同时使用,部署多个软件
绝对成功,自己要用到的环境,千方百计寻找总结出的 亲测有效!
在用maven项目的时候,很多时候不想去再把项目部署到Tomcat上,然后发布并启动,这个时候我们就可以运用Tomcat热部署来配置,只需要再maven的配置文件加上一小段代码即可,非常方便! 启动的时候直接:右键项目--...
java项目发布助手,可以实现将本地的web项目编译后的class文件,通过配置,一键发布到linux服务器上,并重启服务器上的tomcat,并将tomcat启动日志动态的展现在项目发布助手上,实现一劳永逸的效果,只要配置一遍,...
2、多个项目一起部署仅部分系统可以使用。 解决办法:检查每个系统的web.xml配置文件,文件位置: Tomcat服务器下../webapps/项目名称/WEB-INF/web.xml。 【webAppRootKey】与其他项目下的配置值决不可相同!。 ...
有时候我们需要在同一台服务器上部署多个tomcat,本文都是本人实践所得,中间经历了一些问题但是如果您能认真按照文档操作,应该没有问题,本文以windows平台为例,Linux平台也差不多,我自己也试过,希望能帮助您...
NULL 博文链接:https://7shao.iteye.com/blog/1569798
主要介绍了Tomcat部署多个war包的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧