写了一半,不小心关了,重写!!
声明:我实在几周前作的,可能记录不一定全。
Apache配置和iis差不多。我先在一个目录下建立了三个文件夹:
[connector]: 存放mod_jk.so ,在下载时必须考虑版本问题,比如我用的是Apache 2.54 和 Tomcat 5.5.9,我就下载了mod_jk-1.2.13-apache-2.0.54.so,之hoou改名为mod_jk.so.
[log]: mod_jk.log ,mod_jk的日志记录文件
[conf]: 存放配置文件mod_jk.conf,和workers.properties
1.先在Apache的配置文件httpd.conf里加一句:
Include /。。。。。/conf/mod_jk.conf //(换成的mod_jk.conf实际路径,例如E:/conf/mod_jk.conf)
2.编辑mod_jk.conf,大致内容为(假设我那三个文件夹建立在E:盘根目录下,Tomcat安装在E:/Tomcat 5.5/):
# Load mod_jk module
LoadModule jk_module "E:/connector/mod_jk.so"
# Where to find workers.properties
JkWorkersFile "E:/conf/workers.properties"
# Where to put jk logs
JkLogFile "E:/log/mod_jk.log"
# Set the jk log level [debug/error/info]
JkLogLevel debug
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# 示例中的静态文件由Apache处理
Alias /servlets-examples/ "E:/Tomcat 5.5/webapps/servlets-examples/"
<Directory "E:/Tomcat 5.5/webapps/servlets-examples">
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# The following line prohibits users from directly access WEB-INF
<Location "/servlets-examples/WEB-INF/">
AllowOverride None
deny from all
</Location>
# Send servlet for context /examples to worker named ajp13
JkMount /servlets-examples/servlet/* ajp13
Alias /jsp-examples/ "E:/Tomcat 5.5/webapps/jsp-examples/"
<Directory "E:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/jsp-examples">
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# Send JSPs for context /examples to worker named ajp13
JkMount /jsp-examples/*.jsp ajp13
这样就基本配置完成了。