日期:2014-05-16 浏览次数:20786 次
Apache HttpServer与Tomcat的整合见上篇:
http://blog.csdn.net/supercrsky/article/details/8295023
一.配置Tomcat
这里用两个tomcat,直接在已安装目录再复制一个,命名为tomcat2。
#cp -r /opt/tomcat/ tomcat2
进入tomcat2目录,编辑 conf/server.xml,修改默认端口。
#vi conf/server.xml
1. 将
<Server port="8005" shutdown="SHUTDOWN">
改成
<Server port="9005" shutdown="SHUTDOWN">
2.将
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
修改成:
<Connector port="9090" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="9443" />
3. 找到:
<Engine name="Catalina" defaultHost="localhost">
改成
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">
同时把tomcat2中此处内容改成
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2">
4.找到
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
改成
<Connector port="9009" protocol="AJP/1.3" redirectPort="8443" />
5.找到
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" />
把注释取消掉。
二.配置HTTP Server
1.检查是否启动了https,确保下面这句已经被注释。
#Include conf/extra/httpd-ssl.conf
2.找到我们在最文件最下面添加的VirtualHost节点,将其更改为:
<VirtualHost *> DocumentRoot /usr/local/www/ <Directory "