Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat and apache webserver

 
luri ron
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the tomcat server can take http request and hand them over to the jsp/servlet. why do we need a apache webserver that add extra latency?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We don't. Who said that we did?

Sometimes hosts will front Tomcat with Apache if they need something from Apache that Tomcat doesn't support (php, for example). But otherwise, stand-alone Tomcat works just fine.
 
Vadim Vararu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes hosts will front Tomcat with Apache if they need something from Apache that Tomcat doesn't support (php, for example). But otherwise, stand-alone Tomcat works just fine.


Isn't Apache tomcat a combination of both of them? I thought that we can't use tomcat by himself without apache. As well, as i know, apache receive requests, push them to tomcat container that generates the content and push it back to apache....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vadim Vararu wrote:Isn't Apache tomcat a combination of both of them? I thought that we can't use tomcat by himself without apache. As well, as i know, apache receive requests, push them to tomcat container that generates the content and push it back to apache....

No. Tomcat and the Apache Web Server are two different and distinct servers.

As I said, sometimes both are required, for example if both php and Servlet support are needed, but if not, Tomcat can be used standalone.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I find it funny that a lot people refer "Apache HTTP Server" as "Apache", which is in fact just a company name. It may be fairly confusing after all. We don't call "Sun Java" "Sun", do we?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, that's an historical artifact that'll probably be with us for some time to come. I try to be careful and refer to it always as the Apache Web Server, but even I slip up sometimes.
 
luri ron
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the replies. it is clear to me now.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a Webserver with a Container like Tomcat /Weblogic is important becuase

1. We can add extra layer of security say for example SSL
2.Virtual Hosting .
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A separate web server is not necessary to set up either of those.
 
Vadim Vararu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeap guys! Right you are!

Here is a piece of article from wikipedia:

Apache Tomcat is a servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a "pure Java" HTTP web server environment for Java code to run.

Tomcat should not be confused with the Apache web server, which is a C implementation of an HTTP web server; these two web servers are not bundled together. Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files.
 
Praveen Kumar Singh
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat is a standalone container(always call tomcat a container not server) which can handle the basic HTTP requests and use to translate jsp and servlets.

Apache is a HTTP web server.

Now actually tomcat is used with Apache to handle J2EE(non-EJB) applications HTTP request since together they are more robust to handle HTTP request.

Always remember that Apache-Tomcat together is not a complete J2EE application server.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
praveen kumar Singh wrote:Tomcat is a standalone container(always call tomcat a container not server)

Tomcat is very definitely a web server.

Now actually tomcat is used with Apache to handle J2EE(non-EJB) applications HTTP request since together they are more robust to handle HTTP request.

Tomcat is quite robust. As was pointed out above, Apache httpd adds other features that Tomcat doesn't have.
 
Praveen Kumar Singh
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf

I didn't mean that Tomcat is not a server but what i wanted to convey is people prefer to call it container, so call it container not server otherwise yes Tomcat is a HTTP server also.

Now about Robustness, if you read Head First Jsp servlet(2nd edition), on page 65, writer clearly mention only reason we use Apache and Tomcat together it is because of robustness issue.

if you still not convince please mention the source of your information.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i wanted to convey is people prefer to call it container, so call it container not server

I don't know who "people" are, but in my perception the term "container" is mostly used as in "servlet container". Any time it is used as in "web container" (which is rare) confusion arises; so I urge anyone not to use the term "web container", whatever Sun's preferred nomenclature is.

Now about Robustness, if you read Head First Jsp servlet(2nd edition), on page 65, writer clearly mention only reason we use Apache and Tomcat together it is because of robustness issue.

Without context -like how "robustness" is defined- that statement doesn't make much sense. In the general way it's written there -especially containing the word "nearly"- I would dispute it, though.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I repeat and support the statement: use Apache HTTP Server and Apache Tomcat together only and only if you need to add PHP (or PERL or CGI or whatever is supported by Apache HTTP Server) capabilities to the website next to Java EE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic