1、放开一下模块(即去掉前面的注释#)
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
2.放开Include conf/extra/httpd-vhosts.conf文件注释
3.然后打开conf/extra/httpd-vhosts.conf,配置虚拟站点,在最下面加上
ServerAlias localhost
ProxyPass / balancer://jkant/ stickysession=jsessionid nofailover=On
ProxyPassReverse / balancer://jkant/
ErrorLog "logs/jkant-error.log"
CustomLog "logs/jkant-access.log" common
</ VirtualHost >
4.httpd.conf,在文档最下面加上
<proxy balancer://jkant>
BalancerMember ajp://127.0.0.1:8009 loadfactor=1 route=jvm1
BalancerMember ajp://127.0.0.1:9010 loadfactor=1 route=jvm2
</proxy>
5.配置对应的tomcat的server.xml文件
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
如果是单机还要考虑具体的端口