首页 > 网站 > Apache > 正文

RedHatAS5整合Apache和Tomcat服务器应用

2024-08-27 18:29:14
字体:
来源:转载
供稿:网友
 

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/tomcat5workers.java_home=/us/lib/jvm/javaps=/worker.list=ajp13worker.ajp13.port=8009worker.ajp13.host=127.0.0.1worker.ajp13.type=ajp13worker.ajp13.lbfactor=1vi /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


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表