So I understand there are two kinds of servers, first kind is web server (or http server) such as nginx, apache, caddy, another kind is app server, such as tomcat, undertow. I just wonder if a java app server equals a general web server plus a j2ee environment? Or maybe things are not so simple and the app server did a lot of stuff besides just mixing the java environment?
-
Have you read through [the project introduction](http://tomcat.apache.org/)? If so, what specific question do you have? Although Tomcat (and all other servlet containers) do have a built-in web server, you usually use it behind a reverse proxy powered by a dedicated web server (nginx, Apache, IIS). – T.J. Crowder Mar 29 '19 at 09:44
-
Tomcat is a servlet container, not a "full" J2EE server. – Eugène Adell Mar 29 '19 at 10:06
2 Answers
Http server only implements theHttp
standard:it means accepting a Http request
and sending a Http response
.
supporting for php and other languages added via plugins to it(apache and so on).
A raw Http server only support static resources nothing else but statics.
But in java EE world Http server have to implement java EE specifications too. java EE is a set of specifications.
If Http server implements all specifications we have application server
like glassfish.
If Http server only implements servlet and JSP specifications we have servlet container
(also called web server in general)like apache tomcat(from apache foundation.it's not apache web server.its another server),jetty from eclipse foundation.
Any java compatible server is a raw Http server plus some implemented specification.

- 35
- 10
As a seasoned Java developer, the assertion that Tomcat is the same as a web server plus a J2EE environment is irksome, because there are significant differences between Tomcat and Apache in terms of how they are optimized, the role they play in a modern architecture and even how they are physically installed.
You may be right...
Having said that, your assertion may actually be correct. From the standpoint of a beginner, someone new to server-side programming, it's not completely wrong to think of Tomcat as being just a web server with a bunch of magical powers added to it, namely the various Java based APIs Java EE/Jakarta EE builds into it.
Apache and Tomcat in practice
Tomcat does handle http based requests, and it can server files if it needs to, so it can do double duty. So from a simple standpoint, it's not totally wrong to think of Tomcat like that. Just remember that in modern architectures, the role of Tomcat and the Apache HTTP server are very different.
Three tiered architecture
Here's a look at how the two play together in a three tiered architecture:

- 3,684
- 32
- 28