Windows平台整合 Apache HTTP Server 和 Tomcat

Windows 平台安装 Apache HTTP Server

Apache HTTP Server下载地址
http://mirror.bjtu.edu.cn/apache//httpd/binaries/win32/
下载 httpd-2.2.22-win32-x86-openssl-0.9.8t.msi

安装httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
默认安装目录为 C:\Program Files\Apache Software Foundation\Apache2.2

具体安装步骤省略

测试Apache HTTP Server安装是否成功

启动 Apache HTTP Server
在浏览器地址栏输入http://localhost/
页面显示 It works!
说明安装成功

Windows 平台安装 Tomcat

建议选择Tomcat6 具体安装步骤省略

测试Tomcat安装是否成功

启动 Tomcat
访问 http://localhost:8080/examples/
看到 Apache Tomcat Examples 等信息说明整合成功

Windows平台整合 Apache HTTP Server 和 Tomcat  

在 Apache HTTP Server安装目录\conf\

新建文件 workers.properties,编辑该文件,加入以下内容

# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

mod_jk下载地址 http://tomcat.apache.org/download-connectors.cgi
选择binaries然后选择windows,来到最终的下载页面,选择合适的httpd版本
http://www.fayea.com/apache-mirror//tomcat/tomcat-connectors/jk/binaries/windows/
下载 tomcat-connectors-1.2.37-windows-i386-httpd-2.2.x.zip  

解压后得到mod_jk.so,复制到 Apache HTTP Server安装目录\modules\

修改 Apache HTTP Server安装目录\conf\ 下的httpd.conf文件,加入以下内容

# Load mod_jk module
# Update this path to match your modules location
LoadModule    jk_module  modules/mod_jk.so
# Declare the module for <IfModule directive> (remove this line on Apache 2.x)
#AddModule     mod_jk.c
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile     logs/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile     logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel    info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* worker1

检查配置文件httpd.conf修改是否正确
执行 Test Configuration

测试整合是否成功

启动 Tomcat
重启 Apache HTTP Server

访问 http://localhost/examples/
看到 Apache Tomcat Examples 等信息说明整合成功


参考资料

The Apache Tomcat Connector - Generic HowTo Quick Start HowTo
http://tomcat.apache.org/connectors-doc/generic_howto/quick.html

The Apache Tomcat Connector Documentation Index
http://tomcat.apache.org/connectors-doc/

The Apache Tomcat Connector - Reference Guide workers.properties configuration
http://tomcat.apache.org/connectors-doc/reference/workers.html

The Apache Tomcat Connector - Reference Guide Configuring Apache
http://tomcat.apache.org/connectors-doc/reference/apache.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值