1. 复制mod_jk_1.2.5_2.0.47.dll文件到C:
apache2modules目录。
2.
Apache配置:
C:apahce2confhttpd.conf
httpd.conf
在此配置文件最后添加以下语句,用以支持jsp程序:
LoadModule jk_module modules/mod_jk_1.2.5_2.0.47.dll
JkWorkersFile"C:/Tomcat 5.0/conf/workers.properties"
JkMount/servlet/*ajp13
JkMount /*.jsp ajp13
3. 查看C:Tomcat 5.0confserver.xml文件中有关端口“8009”是否被注释,如果是和我这的版本一致的话,不用修改。
4. 在C:Tomcat 5.0conf目录下,新建文件名为“workers.properties”的文件,将如下内容复制到新建文件workers.properties中。
workers.properties
# 只复制以下内容即可:
# 这现行根据安装目录做修改
workers.tomcat_home=C:Tomcat5.0
workers.java_home=C:j2sdk1.4.1_01
photoshop/ target=_blank class=infotextkey>ps=
# worker.list=ajp13
worker.list=ajp12,ajp13
worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp12
worker.ajp12.lbfactor=1
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12, ajp13
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)classes
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)jaxp.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)parser.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)jASP/ target=_blank class=infotextkey>asper.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)servlet.jar
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)common$(ps)lib$(ps)webserver.jar
worker.inprocess.class_path=$(workers.java_home)$(ps)lib$(ps)tools.jar
worker.inprocess.cmd_line=-config
worker.inprocess.cmd_line=$(workers.tomcat_home)/conf/jni_server.xml
worker.inprocess.cmd_line=-home
worker.inprocess.cmd_line=$(workers.tomcat_home)
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)inprocess.stderr
worker.inprocess.sysprops=tomcat.home=$(workers.tomcat_home)
1
5. 到此Apache 和 Tomcat整合完成,重启Apache和Tomcat服务器,
用编辑器编写如下内容:
<%@ page contentType="text/html;charset=gb2312"%>
<html>
<head>
<title>HI-JSP实验</title>
</head>
<body>
<%
StringMsg="This is JSP test! 看到这段话,恭喜你,成功了!";
out.print("Hello World!");
%>
<h3><%=Msg%></h3>
The current date and time is<%=newjava.util.Date()%> 《Apache+Tomcat+MySQL的整合》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Server/Apache/18028.html