|
1.下载jdk-1_5_0_06,httpd-2.0.55.tar.gz,apache-tomcat-5.5.16.tar.gz,jakarta-tomcat-connectors-1.2.15-src.tar.gz
2.编译apache
#./configure --prefix=/opt/apache --enable-modules=so;make;make install
3.解压tomcat,在/opt/tomcat/bin/startup.sh和shutdown.sh中添加环境变量JAVA_HOME
4.解压tomcat-connectors
#cd jk/native
#./configure --with-apxs=/opt/apache/bin/apxs;make;make install
5.建立 /opt/apache/conf/workers.properties,添加以下内容:
workers.tomcat_home=/opt/tomcat/
workers.java_home=$JAVA_HOME
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
6.在/opt/apache/conf/httpd.conf最后添加
LoadModule jk_module modules/mod_jk.so
<IfModule mod_jk.c>
JKWorkersFile /opt/apache/conf/workers.properties
JKLogFile /var/log/mod_jk.log
JKLogLevel warn
JKMount /*.jsp ajp13
</IfModule>
6.启动
#/opt/tomcat/bin/startup.sh
#/opt/apache/bin/apachectl start
测试的test.jsp放到/opt/tomcat/webapps/ROOT,用 http://localhost/test.jsp 看看
参考:http://www.freebsdchina.org/forum/topic_30435.html
-------------------------------------------------------------------------------------------------------------------
Apache 2.2.x 整合 tomcat
The AJP proxy is a new module based on the standard Http proxy it uses AJP instead of HTTP.
<Location /examples/>
ProxyPass ajp://localhost:8009/examples/
</Location>
http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html |
|