FTP地址:ftp://www.linuxidc.com
在 2011年LinuxIDC.com\7月\LAMP+Tomcat+Discuz+WordPress 【Tomcat的安装整合】
安装tomcat
[root@localhost LAMP]#tar zxvf jakarta-tomcat-5.5.9.tar.gz
[root@localhost LAMP]#cd jakarta-tomcat-5.5.9
[root@localhost LAMP]#mkdir -p /usr/local/tomcat/
[root@localhost LAMP]#cp -rf * /usr/local/tomcat/【拷贝所有解压出来的文件到/usr/local/tomcat/】
[root@localhost LAMP]#cd /usr/local/tomcat/bin
[root@localhost bin]#./startup.sh 【启动tomcat】
[root@localhost bin]#./shutdown.sh 【停止tomcat】
安装apr、aprutil、libtool
安装apr
[root@localhost LAMP]#tar zxvf apr-1.4.5.tar.gz
[root@localhost LAMP]#cd apr-1.4.5
[root@localhost apr-1.4.5]#./configure --prefix=/usr/local/apr【最好指定安装目录】
[root@localhost apr-1.4.5]#make
[root@localhost apr-1.4.5]#make install
安装aprutil
[root@localhost LAMP]# tar zxvf apr-util-1.3.12.tar.gz
[root@localhost LAMP]#cd apr-util-1.3.12
[root@localhost apr-util-1.3.12]# ./configure --prefix=/usr/local/aprutil --with-apr=/usr/local/apr【最好指定安装目录】
[root@localhost apr-util-1.3.12]# make
[root@localhost apr-util-1.3.12]# make install
安装完apr和aprutil后
[root@localhost apr-util-1.3.12]# ln-s /usr/local/apr/lib/libapr-1.so.0.4.5 /usr/local/apache/lib/libapr-1.so
[root@localhost apr-util-1.3.12]# ln-s /usr/local/apr/lib/libapr-1.so.0.4.5 /usr/local/apache/lib/libapr-1.so.0
[root@localhost apr-util-1.3.12]# ln-s /usr/local/aprutil/lib/libaprutil-1.so.0.3.12/usr/local/apache/lib/libaprutil-1.so
[root@localhost apr-util-1.3.12]# ln-s /usr/local/aprutil/lib/libaprutil-1.so.0.3.12/usr/local/apache/lib/libaprutil-1.so.0
安装libtool
[root@localhost LAMP]#tar zxvf libtool-2.4.tar.gz
[root@localhost LAMP]#cd libtool-2.4
[root@localhost libtool-2.4]#./configure --prefix=/usr/local/libtool
[root@localhost libtool-2.4]#make
[root@localhost libtool-2.4]#make install
[root@localhost libtool-2.4]#cd /usr/local/apache/build/
[root@localhost build]# rm -rf libtool【删除旧版本的libtool】
[root@localhost build]# ln-s /usr/local/libtool/bin/libtool /usr/local/apache/build/libtool
安装jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz
[root@localhost LAMP]#tar zxvf jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz
[root@localhost LAMP]#cd jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2/
[root@localhost native2]#./configure --with-apxs2=/usr/local/apache/bin/apxs 【注意apxs的路径】
[root@localhost native2]# make【一定记得make,否则找不到build/jk2/mod_jk2.so囧 我当时就忘了。】
[root@localhost native2]cd../build/jk2/apache2/
[root@localhost native2]/usr/local/apache/bin/apxs -n jk2 -i mod_jk2.so 【将mod_jk2.so添加到apache2的modules中】
[root@localhost native2]cd /usr/local/apache/modules/
[root@localhost modules]chmod 755 mod_jk2.so
上面就完成了Tomcat和Connectors的安装.
接下来进行与Apache的整合
[root@localhost LAMP]#cd /usr/local/apache/conf/
[root@localhost conf]#vim httpd.conf
加入LoadModulejk2_module modules/mod_jk2.so
然后在这个目录新建一文件workers2.properties
[root@localhost conf]#vim workers2.properties