wood burning stoves 2.0*
The moose likes Tomcat and the fly likes tomcat and apache webserver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat and apache webserver" Watch "tomcat and apache webserver" New topic
Author

tomcat and apache webserver

luri ron
Ranch Hand

Joined: Dec 11, 2008
Posts: 86
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

Joined: Jan 10, 2002
Posts: 60057
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147
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....


If you think you've done too much, usually it means you've done too few.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

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

Joined: Oct 08, 2006
Posts: 2458
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

Joined: Jan 10, 2002
Posts: 60057
    
  65

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

Joined: Dec 11, 2008
Posts: 86
thanks for the replies. it is clear to me now.
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
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 .


If you want something you never had do something which you had never done
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

A separate web server is not necessary to set up either of those.
Vadim Vararu
Ranch Hand

Joined: Jan 03, 2009
Posts: 147
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

Joined: Mar 04, 2009
Posts: 43
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.


Praveen
SCJP, SCWCD, SOA
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
Praveen Kumar Singh
Ranch Hand

Joined: Mar 04, 2009
Posts: 43
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
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
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

Joined: Oct 08, 2006
Posts: 2458
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat and apache webserver
 
Similar Threads
integration
WebLogic Questions
Apache and Servlets
Tomcat access
webserver