aspose file tools*
The moose likes General Computing and the fly likes [architecture]  Why put a web server infront of application/web server? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "[architecture]  Why put a web server infront of application/web server?" Watch "[architecture]  Why put a web server infront of application/web server?" New topic
Author

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

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
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

Joined: Jul 08, 2003
Posts: 24187
    
  34

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.

    [Jess in Action][AskingGoodQuestions]
    Jesus Angeles
    Ranch Hand

    Joined: Feb 26, 2005
    Posts: 2057
    Thanks for the ideas.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: [architecture] Why put a web server infront of application/web server?