首页 > 其他 > 详细

centos下配置多个tomcat同时运行

时间:2015-04-22 13:05:19      阅读:104      评论:0      收藏:0      [点我收藏+]

首先安装好jdk,下载好tomcat,我的是apache-tomcat-7.0.50,不用专门配置CATALINA_2_BASE,CATALINA_2_HOME等环境变量。

把tomcat解压到linux两个不同的文件夹下,然后把各自conf下的server.xml打开修改关闭端口与启动端口。这样就可以在linux下同时运行两个tomcat了。运行更多tomcat方法是一样的。

<Server port="
8005
" shutdown="SHUTDOWN">
<Connector port="
8888
" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
<Connector port="
8009
" protocol="AJP/1.3" redirectPort="8443" />

启动好后有时候会打不开网页,可能是iptables 阻止了端口;顺带说明iptables 的开启与关闭。

1. Linux防火墙(Iptables)重启系统生效

  1. 开启: chkconfig iptables on 
  2.  
  3. 关闭: chkconfig iptables off 
  4.  

2.Linux防火墙(Iptables) 即时生效,重启后失效

  1. 开启: service iptables start 
  2.  
  3. 关闭: service iptables stop 
  4.  

需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

在开启了Linux防火墙(Iptables)时,做如下设置,开启25和110端口,

修改/etc/sysconfig/iptables 文件,添加以下内容:

  1. -A RH-Firewall-1-INPUT -m state --state NEW -p tcp -m tcp --dport 25 --syn -j ACCEPT 
  2.  
  3. -A RH-Firewall-1-INPUT -m state --state NEW -p tcp -m tcp --dport 110 --syn -j ACCEPT 

centos下配置多个tomcat同时运行

原文:http://www.cnblogs.com/qingyizhishi/p/4446723.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!