Apache/Tomcat error - wrong pages being delivered

后端 未结 11 937
借酒劲吻你
借酒劲吻你 2020-12-09 05:51

This error has been driving me nuts. We have a server running Apache and Tomcat, serving multiple different sites. Normally the server runs fine, but sometimes an error happ

11条回答
  •  既然无缘
    2020-12-09 06:41

    We switched Apache from proxying with AJP to proxying with HTTP. So far it appears to have solved the issue, or at least vastly reduced it - the problem hasn't been reported in months, and the app's use has increased since then.

    The change is in Apache's httpd.conf. Having started with mod_jk:

    JkMount /portal ajp13
    

    We switched to mod_proxy_ajp:

    ProxyPass /portal ajp://localhost:8009/portal
    

    Then finally to straight mod_proxy:

    ProxyPass /portal http://localhost:8080/portal
    

    You'll need to make sure Tomcat is set up to serve HTTP on port 8080. And remember that if you're serving /, you need to include / on both sides of the proxy or it starts crying:

    ProxyPass / http://localhost:8080/
    

提交回复
热议问题