1. 安装Apache和Tomcat,这里假定Apache2.2.3,Tomcat6.x

2. 修改/etc/httpd/conf/httpd.conf文件,确定以下行没有被注释掉

  LoadModule proxy_module modules/mod_proxy.so

  LoadModule proxy_http_module modules/mod_proxy_http.so

  LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

3. 添加以下行到/etc/httpd/conf/httpd.conf文件中

  ProxyPass /tomcat/ ajp://localhost:8009/

  ProxyPass /examples/ ajp://localhost:8009/examples/

  或者

  ProxyPass /tomcat/ http://localhost:8080/

  ProxyPass /examples/ http://localhost:8080/examples/

  这里假定Apache和Tomcat安装在一个机器上,否则修改以上localhost成Tomcat安装机器;

4. 启动Tomcat 和Apache,访问http://localhost/examples/