分类: LINUX
2009-07-06 14:26:04
1. 安装java环境
# ./jdk-1_5_0_18-linux-i586-rpm.bin
# vim /etc/profile
export
JAVA_HOME="/usr/java/jdk
export
CLASS_PATH="/usr/java/jdk
pathmunge /usr/java/jdk
2. 安装jk
# cd /root/jakarta-tomcat-connectors-
# ./configure --with-apxs=/usr/local/apache2/bin/apxs
# make
# make install
# cp /usr/local/apache2/modules/mod_jk.so /etc/httpd/modules/
3. 创建workers.properties文件
# vim /etc/httpd/conf/workers.properties
worker.list=worker1
worker.worker1.port=8009 #工作端口,若没占用则不用修改
worker.worker1.host=localhost #Tomcat服务器的地址
worker.worker1.type=ajp13 #类型
worker.worker1.lbfactor=1 #负载平衡因数
4. 修改Apache服务器的配置文件httpd.conf
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug
JkMount /*.jsp worker1
JkMount /helloapp/* worker1
5. 启动tomcat
# /usr/local/tomcat/bin/startup.sh
6. 测试
# cp -r helloapp/ /usr/local/tomcat/webapps/