你想过你的jsp文件为什么只能放在/tomcat/webapps/examples/下了吗?这是问题的所在啊 你先看看以下的整合过程,就能找出问题的所在1.修改server.xml 在<host></host>内添加<Context path="" docBase="你的路径" debug="0"/> 2.修改httpd.conf 加入LoadModule jk2_module modules/mod_jk2.so 修改DocumentRoot与tomcat同步 建立虚拟主机 <VirtualHost _default_:80> ServerName localhost DocumentRoot d:/public_html DirectoryIndex index.htm index.html default.htm index.jsp <Location ~ "/*.jsp|/*/servlet/*"> JkUriSet worker ajp13:localhost:8009 </Location> ErrorLog logs/home.net-err_log CustomLog logs/home.net-acc_log common </VirtualHost> 在httpd.conf的同一目录下建立workers2.properties #---- worker2.properties [logger.apache2] level=DEBUG # Shared memory handling. Needs to be set. [shm] info=Scoreboard. Requried for reconfiguration and status with multiprocess servers. file=anon# Defines a load balancer named lb. Use even if you only have one machine. [lb:lb]# Example socket channel, explicitly set port and host. [channel.socket:localhost:8009] tomcatId=localhost:8009 port=8009 host=127.0.0.1 # define the worker [ajp13:localhost:8009] channel=channel.socket:localhost:8009 #[status:status] # Uri mapping #[uri:/jkstatus/*] #group=status:status #[uri:/jsp-examples/*] #group=ajp13:localhost:8009 #[uri:/servlets-examples/*] #group=ajp13:localhost:8009 #[uri:/javaapp/*] #group=ajp13:localhost:8009 #[uri:202.92.33.125/*.jsp] #worker=ajp13:localhost:8009#[uri:127.0.0.1/*] #worker=ajp13:localhost:8009 #---- end of workers2.properties
你先看看以下的整合过程,就能找出问题的所在1.修改server.xml 在<host></host>内添加<Context path="" docBase="你的路径" debug="0"/>
2.修改httpd.conf
加入LoadModule jk2_module modules/mod_jk2.so
修改DocumentRoot与tomcat同步
建立虚拟主机
<VirtualHost _default_:80>
ServerName localhost
DocumentRoot d:/public_html
DirectoryIndex index.htm index.html default.htm index.jsp
<Location ~ "/*.jsp|/*/servlet/*">
JkUriSet worker ajp13:localhost:8009
</Location>
ErrorLog logs/home.net-err_log
CustomLog logs/home.net-acc_log common
</VirtualHost>
在httpd.conf的同一目录下建立workers2.properties
#---- worker2.properties [logger.apache2]
level=DEBUG # Shared memory handling. Needs to be set.
[shm]
info=Scoreboard. Requried for reconfiguration and status with multiprocess servers.
file=anon# Defines a load balancer named lb. Use even if you only have one machine.
[lb:lb]# Example socket channel, explicitly set port and host.
[channel.socket:localhost:8009]
tomcatId=localhost:8009
port=8009
host=127.0.0.1 # define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009 #[status:status] # Uri mapping #[uri:/jkstatus/*]
#group=status:status #[uri:/jsp-examples/*]
#group=ajp13:localhost:8009 #[uri:/servlets-examples/*]
#group=ajp13:localhost:8009 #[uri:/javaapp/*]
#group=ajp13:localhost:8009 #[uri:202.92.33.125/*.jsp]
#worker=ajp13:localhost:8009#[uri:127.0.0.1/*]
#worker=ajp13:localhost:8009 #---- end of workers2.properties