开发者

Apache install before Tomcat, what is the advantage?

Ive read so often that an Apache Webserver should be installed before an tomcat to achieve better performance. They say. that tomcat can't provide static files as well a开发者_运维技巧s the Apache.

I would like to understand how it works in detail. I researched the internet, but I didnt find any good explanation.

  • A client sends a request
  • The request goes to the Apache
  • If the request is for a static file, the Apache gets the static file and gives it back to the client
  • If the request is for a dynamic file (like jsp), the apache gives the request to the tomcat
  • the tomcat generates the file
  • the tomcat gives the response back to the Apache
  • Apache sends to response to the user

Is that correct??? Or do requests for static files also go to the Tomcat? Then why is Apache needed?

Thanks for clarifying it :-)


Yes you got it pretty much right. Static requests are usually served by Apache and not forwarded to Tomcat server.

You can use mod_jk or mod_proxy_ajp to forward your dynamic requests to Tomcat.

Another advantage of using Apache in front is load bakancing of your traffic.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜