整合Apache+Tomcat实战
时间:2006-02-10 来源:sminpas
# *******************************************
# *** 整合Apache+Tomcat实战 ***
# *** 环境: ***
# *** OS:TSL2.1 ***
# *** Apache:2.0.55 ***
# *** Tomcat:4.1.31 ***
# *** J2sdk:1.4.2_10 ***
# *** by sminpas 2006-01-13 *** # *** E-mail:[email protected] ***
# *******************************************
#
#
1.下载 jakarta-tomcat-connectors-1.2.15-src.tar.gz
wget http://jakarta.apache.org/downloads/connectors/jakarta-tomcat-connectors-1.2.15-src.tar.gz 2.安装编译
gunzip -c jakarta-tomcat-connectors-1.2.15-src.tar.gz|tar xvf -
cd jakarta-tomcat-connectors-1.2.15-src/jk/native
./buildconf.sh
./configure --with-apxs=/usr/local/apache/bin/apxs --with-java-home=/usr/java/j2sdk
make
make install
cp apache-2.0/mod_jk.so /usr/local/apache/modules/ 3.更改Apache的主配置文件httpd.conf
cd /usr/local/apache/conf
vi httpd.conf
# 在适当的位置加入以下内容
#
# ********* New Add by sminpas 2006-01-13 **********
LoadModule jk_module modules/mod_jk.so
#
# # 指定“mod_jk”工作配置文件,文件名可自定义,但与下文所创建的wkrkers文件名必#须保持一致
JkWorkersFile /usr/local/apache/conf/workers.sminpas
#
# # 日志保存的路径以及文件名
JkLogFile /usr/local/apache/logs/mod_jk.log
#
# 设置日志记录级别 [debug/error/info] #
JkLogLevel info
# 设置日志格式
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
#
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
#
# Send JSPs for context /examples to worker named sminpas
# 指定JSP处理的目录,“*.jsp”是指只把扩展名为“.jsp”的文件交给tomcat来处理
# 在Tomcat的配置文件“server.xml”必须有相应的“/examples”目录指向
JkMount /examples/*.jsp sminpas
#
# ***************** END ***********************
# 4.创建 workers.sminpas 文件
#
cd /usr/local/apache/conf
vi workers.sminpas
# 加入以下内容
#
# ****** New Add by sminpas 2006-01-13 **********
# Define 1 real worker using ajp13
worker.list=sminpas
#
# Set properties for sminpas (ajp13)
worker.sminpas.type=ajp13
worker.sminpas.host=localhost
worker.sminpas.port=8009
worker.sminpas.lbfactor=50
worker.sminpas.cachesize=10
worker.sminpas.cache_timeout=600
worker.sminpas.socket_keepalive=1
worker.sminpas.socket_timeout=300
#
# ************ END ****************
# 5.启动服务
# 必须先启动TOMCAT后,再启动Apache,中间要有足够时间
/usr/local/tomcat4/bin/startup.sh
/usr/local/apache/bin/apachectl start
#
6.停止服务 /usr/local/apache/bin/apachectl stop
/usr/local/tomcat4/bin/shutdown.sh
# *** 整合Apache+Tomcat实战 ***
# *** 环境: ***
# *** OS:TSL2.1 ***
# *** Apache:2.0.55 ***
# *** Tomcat:4.1.31 ***
# *** J2sdk:1.4.2_10 ***
# *** by sminpas 2006-01-13 *** # *** E-mail:[email protected] ***
# *******************************************
#
#
1.下载 jakarta-tomcat-connectors-1.2.15-src.tar.gz
wget http://jakarta.apache.org/downloads/connectors/jakarta-tomcat-connectors-1.2.15-src.tar.gz 2.安装编译
gunzip -c jakarta-tomcat-connectors-1.2.15-src.tar.gz|tar xvf -
cd jakarta-tomcat-connectors-1.2.15-src/jk/native
./buildconf.sh
./configure --with-apxs=/usr/local/apache/bin/apxs --with-java-home=/usr/java/j2sdk
make
make install
cp apache-2.0/mod_jk.so /usr/local/apache/modules/ 3.更改Apache的主配置文件httpd.conf
cd /usr/local/apache/conf
vi httpd.conf
# 在适当的位置加入以下内容
#
# ********* New Add by sminpas 2006-01-13 **********
LoadModule jk_module modules/mod_jk.so
#
# # 指定“mod_jk”工作配置文件,文件名可自定义,但与下文所创建的wkrkers文件名必#须保持一致
JkWorkersFile /usr/local/apache/conf/workers.sminpas
#
# # 日志保存的路径以及文件名
JkLogFile /usr/local/apache/logs/mod_jk.log
#
# 设置日志记录级别 [debug/error/info] #
JkLogLevel info
# 设置日志格式
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
#
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
#
# Send JSPs for context /examples to worker named sminpas
# 指定JSP处理的目录,“*.jsp”是指只把扩展名为“.jsp”的文件交给tomcat来处理
# 在Tomcat的配置文件“server.xml”必须有相应的“/examples”目录指向
JkMount /examples/*.jsp sminpas
#
# ***************** END ***********************
# 4.创建 workers.sminpas 文件
#
cd /usr/local/apache/conf
vi workers.sminpas
# 加入以下内容
#
# ****** New Add by sminpas 2006-01-13 **********
# Define 1 real worker using ajp13
worker.list=sminpas
#
# Set properties for sminpas (ajp13)
worker.sminpas.type=ajp13
worker.sminpas.host=localhost
worker.sminpas.port=8009
worker.sminpas.lbfactor=50
worker.sminpas.cachesize=10
worker.sminpas.cache_timeout=600
worker.sminpas.socket_keepalive=1
worker.sminpas.socket_timeout=300
#
# ************ END ****************
# 5.启动服务
# 必须先启动TOMCAT后,再启动Apache,中间要有足够时间
/usr/local/tomcat4/bin/startup.sh
/usr/local/apache/bin/apachectl start
#
6.停止服务 /usr/local/apache/bin/apachectl stop
/usr/local/tomcat4/bin/shutdown.sh
相关阅读 更多 +