class="23181">
;
AS5下自帶了Tomcat5,這個非常方便,建議大家將RPM包全部cp下來,然後用YUM安裝,這個不是本文討論的重點.在AS5下安裝Tomcat非常方便,Apache采用RPM包安裝.
1.下載mod_jk
目前mod_jk連接器穩定版本是1.2.23,使用Web浏覽器訪問http://www.apache.org/dist/tomca ... es/linux/jk-1.2.23/,下載mod_jk-1.2.23-apache-2.2.x-linux-i686.so.
2.安裝和配置mod_jk
mv mod_jk-1.2.23-apache-2.2.x-linux-i686.so /etc/httpd/modules/mod_jk.so
在/usr/share/tomcat5/conf目錄中新建子目錄jk,並新建文件works.properties.內容如下:
workers.tomcat_home=/usr/share/tomcat5
workers.java_home=/us/lib/jvm/java
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
vi /usr/share/tomcat5/conf/server.xml,在語句下添加
重新啟動tomcat5
cp /usr/share/tomcat5/conf/auto/mod_jk.conf /usr/share/tomcat5/conf/jk
mv /usr/share/tomcat5/conf/jk/mod_jk.conf /usr/share/tomcat5/conf/jk/mod_jk.conf-auto
vi /usr/share/tomcat5/conf/mod_jk.conf-auto,將此文件內容更改如下:
loadModules jk_module "/etc/httpd/modules/mod_jk.so"
JkWorkersFile "/usr/share/tomcat5/conf/jk/workers.properties"
JkLogFile "/usr/share/tomcat5/logs/mod_jk.log"
JkLogLevel emerg
ServerNmae localhost
JkMount /*.jsp ajp13
3.配置Tomcat vi /usr/share/tomcat5/conf/server.xml
在xmlValidation="false" xmlNamespaceAware="false">在其後添加以下語句:
4.配置Apache vi /etc/httpd/conf/httpd.conf
在最後一行添加如下語句:
Include /usr/share/tomcat5/conf/jk/mod_jk.conf-auto
5.重新啟動Apache服務和Tomcat服務.
6.測試Apache和Tomcat整合
vi /var/www/html/test.jsp
Hello!The time is