[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.java.programmer

Re: Is it necessary to have both an application server AND a web server?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

6/11/2016 9:44:00 PM

On 6/10/2016 6:48 PM, Qu0ll wrote:
> I have often noticed that in many places where I have worked, the
> companies have both a full application server such as JBoss/Wildfly AND
> a web server (typically Apache) installed and both seem to work together.
>
> 1) Is this necessary and if so, why?
> 2) What does a web server "provide" that an application server doesn't?
> 3) What is the nature of the relationship or interaction between both
> applications?

The setup:

--Apache httpd--Tomcat/JBoss/whatever

is very common.

It is not strictly necessary, but it does provide some benefits.

Probably the most important is the security aspect. Because the
flow above is an oversimplification. Usually it is:

internet| DMZ | secure network zone
--Firewall--Apache httpd with mod_security--Firewall--Tomcat/JBoss/whatever

where the Apache httpd in DMZ is used to protect the application.

In many security minded environments you would not be allowed to
expose an application without a proxy in DMZ in front of it.

In the old days there were a performance benefit by terminating SSL
in Apache httpd instead of in Tomcat/JBoss/whatever, because Apache
httpd had native highly optimized SSL code while Java SSL was not quite
as efficient.

That is not important today as SSL would typical be offloaded
in a network box not in a real server (network boxes today are really
servers inside, but you know what I mean).

Then there is the static content. Often it has advantages to
serve that by Apache httpd instead of Tomcat/JBoss/whatever.

Tomcat/JBoss/whatever can serve static content but there are
some reasons why a dedicated server may be better in many
cases:
* a web server written to serve static content may be more
efficient than a Java app server, where support for static
content may have been a very low priority in development.
* Apache httpd comes with advanced options for cache control
that Tomcat/JBoss/whatever does not have.
* the static content may be produced by a different team than
the one producing the Java web app, so requiring the static
content to be bundled into the war file can be an organizational
hassle.

Arne