八、Tomcat与Apache的整合器(jakarta-tomcat-connectors Ver.2.0.4)
1、下载
linuxforum.net/dist/jakarta/tomcat-connectors/jk2/jakarta-tomcat-connectors-jk2-src-current.tar.gz" target="_blank"> ... -src-current.tar.gz
2、安装
(1)解压缩下载的包至/usr/local/src/下。
(2)进入目录
#cd /usr/local/src/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2
(3)编译安装
#./configure --with-apxs2=/usr/local/apache/bin/apxs
#make
#cd ../build/jk2/apache2
#/usr/local/apache/bin/apxs -n jk2 -i mod_jk2.so
(4)编辑Apache配置文件/usr/local/apache/conf/httpd.conf
在LoadModule加入如下一行:
LoadModule jk2_module modules/mod_jk2.so
(5)在/usr/local/apache/conf/目录下编辑保存一个名为workers2.properties的文本文件,内容为:
[logger]
level=ERROR
[config:]
file=/usr/local/apache2/conf/workers2.properties
debug=0
debugEnv=0
# Alternate file logger
[logger.file]
#level=DEBUG
level=ERROR
file=/var/log/httpd/jk2.log
[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=/var/log/httpd/jk2.shm
size=1048576
debug=0
disabled=0
[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009
keepalive=1
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
debug=0
[status:]
info=Status worker, displays runtime informations
[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
worker=ajp13:localhost:8009
[uri:/*.jsp]
worker=ajp13:localhost:8009
context=/
(6)修改/usr/local/tomcat5.0.30/conf/server.xml,在
<Host debug="0" appBase="apps" unpackWARs="true" autoDeploy="true">
下方加入这行:
<Context path="" docBase="/var/www/html" debug="0" reloadable="true" crossContext="true"/>
保存退出。
(7)测试
A)方法一:Firefox地址栏输入,看看JSP Samples及其两列图标链接了吧。
B)方法二:在/var/www/html/下编辑一test.jsp文件,内容为以下五行:
<%@ page language="java" contentType="text/html;charset=gb2312"%>
<%
out.print("<font color=red>This is JSP's test page!</font><br><br>");
%>
Hello! The time is now <%= new java.util.Date() %>
再在Firefox地址栏输入,有输出下面两行文件吗?
This is JSP's test page!
Hello! The time is now Wed Mar 09 02:34:15 CST 2005
OK,所有的工作就告一段落了,大功告成!
web服务器建设是一项十分繁杂的工作,以上只是初步完成在本机调试HTML、PHP、JSP及其调用MySQL的服务器环境。
要真正完成在Internet上实际应用的web服务器,毫无疑问还有很多工作要做。
RHEL AS 4下web服务器安装调试详细教程(7)
内容版权声明:除非注明,否则皆为本站原创文章。