Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[architecture] Why put a web server infront of application/web server?

 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I run a tomcat server for my web application. The user connects directly to the tomcat server which serves as my application server too.

In the company where I work at, they use a separate web server, infront of the application server.

Why is it done so? Why is there a need for another web server layer?

One guy told me that is helps in security. I agree. A hacker can hurt only the web server layer, and not affect the application layer.

I will appreciate all your comments, on why is it advisable and/or needed.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are quite a few reasons why this is done:

  • Security, as you mention; more like integration with things like Kerberos than protection from hackers.
  • Load-balancing. You can have one Apache, lots of Tomcats on different machines, to spread the load around.
  • Virtual hosting. Just one Apache, but lots of Tomcats each servicing a different virtual host. Apache sends the right requests to the right Tomcat.
  • Flexibility. You can easily mix non-Java apps running on Apache with your Java app running on Tomcat.


  • That said, I have run plenty of web sites with Tomcat directly facing the Net. There's nothing wrong with doing it that way; if you don't need Apache, you don't need it. Plenty of small to medium sites don't.
     
    Jesus Angeles
    Ranch Hand
    Posts: 2068
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks for the ideas.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic