deles 发表于 2016-12-30 10:53:31

tomcat 和 apache 整合

1、Apache安装过程中设置Network Domain和Server Name为localhost,并设置你的email地址

将下载好的mod_jk-1.2.26-httpd-2.0.59.so放在modules目下下。

以上安装全部完成后,打开cmd命令提示符,运行d:\Apache\Apache2\bin\Apache.exe -t 你将会看

到"Syntax OK"

2、
在apache的conf目录下, 新建workers.properties和 uriworkermap.properties内容如下:

workers.properties :


worker.list=ajp13, status #模块版本

# 8009 is the tomcat's port: for example<Connector port="8009" protocol="AJP/1.3"

redirectPort="8443" />
worker.ajp13.port=8009 #工作端口,若没占用则不用修改
worker.ajp13.host=localhost #本机,若上面的Apache主机不为localhost,作相应修改
worker.ajp13.type=ajp13 #类型
worker.ajp13.lbfactor=1 #代理数,不用修改

#another worker
worker.status.type=status

uriworkermap.properties:


#default handled by ajp13
/*=ajp13

#jkstatus is handled by status
/jkstatus=status

#*.gif and *.jpg and so on handled by apache
!/*.gif=ajp13
!/*.jpg=ajp13
!/*.png=ajp13
!/*.css=ajp13
!/*.js=ajp13
!/*.htm=ajp13
!/*.html=ajp13

修改httpd.conf,在配置文件末尾增加


#

LoadModule jk_module modules/mod_jk-1.2.26-httpd-2.0.59.so

#
# Configure mod_jk
#

JkWorkersFile conf/workers.properties
JkMountFile conf/uriworkermap.properties
JkLogFile logs/mod_jk.log
JkLogLevel warn


3、再次运行:\Apache\Apache2\bin\Apache.exe -t 如果你会看

到"Syntax OK", 则整合成功。

4、启动apache 和 tomcat . 分别输入http://localhost和 http://localhost:8080验证结果。
页: [1]
查看完整版本: tomcat 和 apache 整合