Why use Apache Web Server in front of Glassfish or Tomcat?

后端 未结 5 1332
遇见更好的自我
遇见更好的自我 2020-12-07 09:08

Is it good idea to use Apache Webserver in front of GF or Tomcat? Does it improve the performance/security?

Or there is not any reason to use Apache Web Server with

5条回答
  •  再見小時候
    2020-12-07 09:43

    Since everybody gave you reasons why to put Apache in front of Tomcat let me give you some reasons why not to:

    • The AJP connector does not and will not support advanced IO meaning no Comet, Websockets, etc.
    • If you're not using AJP I have noticed there is a pretty big proxy overhead when using mod_proxy for Apache. So if you're looking for low latency Apache in front would not be good.
    • Apache has a rather big foot print compared to Nginx or Lighttpd etc.

    Putting Apache in front does NOT:

    • Improve performance. Tomcat will run just as fast as Apache (in some cases faster) with APR.
    • Improve Security. I don't think I have ever seen a true security problem with Tomcat. I don't know where this BS comes from that Tomcat is less secure than Apache.

    What Apache does give you is more plugins and allows you to run different web technologies.

    If you only need Tomcat you would be better suited to use a HAProxy or Nginx as load balancer.

提交回复
热议问题