Difference between Apache Web Server and Tomcat Server

Discussion in 'Java' started by BIG BOY, Sep 6, 2006.

  1. BIG BOY

    BIG BOY Guest

    Sir I am little bit confused about Apache Web Server and Apache Tomcat
    Server. Please give me an link so that i can find it out.
     
    BIG BOY, Sep 6, 2006
    #1
    1. Advertising

  2. BIG BOY wrote:

    > Sir I am little bit confused about Apache Web Server and Apache Tomcat
    > Server. Please give me an link so that i can find it out.


    apache web server is a webserver.
    tomcat is a servlet container.


    --
    Davide Consonni <> http://csvtosql.sourceforge.net
    "L'uomo e' un animale che gioca, e il computer e' un altro mezzo per
    giocare." -- Scott Adams
     
    Davide Consonni, Sep 6, 2006
    #2
    1. Advertising

  3. BIG BOY

    Matt Rose Guest

    Davide Consonni wrote:
    > BIG BOY wrote:
    >
    > > Sir I am little bit confused about Apache Web Server and Apache Tomcat
    > > Server. Please give me an link so that i can find it out.

    >
    > apache web server is a webserver.
    > tomcat is a servlet container.
    >


    Apache is what your browser connects to, tomcat is what apache connects
    to to ask for servlets to be processed. However, tomcat now includes a
    webserver so you can cut out the middle man. You might not want to do
    this on a large production environment.

    Matt
     
    Matt Rose, Sep 6, 2006
    #3
  4. BIG BOY

    Guest

    Davide Consonni wrote:
    > BIG BOY wrote:
    >
    > > Sir I am little bit confused about Apache Web Server and Apache Tomcat
    > > Server. Please give me an link so that i can find it out.

    >
    > apache web server is a webserver.
    > tomcat is a servlet container.


    nitpicking a bit... You make it sound like Tomcat cannot act as a web
    server.

    Tomcat can run either in stand-alone mode or "connected" to Apache.

    In stand-alone mode, Tomcat can process servlets (and JSPs) and can
    serve static content as well... And it does it *very* fast.

    Tomcat is actually, for many uses, a very good web server.

    Note that there are case where it is more appropriate to
    use Apache + Tomcat just as there are case where it is
    more appropriate to use Tomcat in stand-alone mode.
     
    , Sep 6, 2006
    #4
  5. wrote:

    > In stand-alone mode, Tomcat can process servlets (and JSPs) and can
    > serve static content as well... And it does it *very* fast.


    ok, but apache httpd is faster than tomcat and has a better virtual host
    management.
    usually people but tomcat behind apache with a connector ..

    --
    Davide Consonni <> http://csvtosql.sourceforge.net
    Un padre e' un banchiere fornito dalla natura.
     
    Davide Consonni, Sep 6, 2006
    #5
  6. BIG BOY

    Tom Cole Guest

    Davide Consonni wrote:
    > wrote:
    >
    > > In stand-alone mode, Tomcat can process servlets (and JSPs) and can
    > > serve static content as well... And it does it *very* fast.


    Second that.

    >
    > ok, but apache httpd is faster than tomcat and has a better virtual host
    > management.
    > usually people but tomcat behind apache with a connector ..


    Bet you can't find supporting data for that (usually people put tomcat
    behind apache with a connector). My bet would be that most small to
    mid-sized sites don't. I have situations with both (actually I have a
    third scenario with IIS in front of Tomcat as well) and see no
    significant difference in response times. Then again I'm only talking
    about dealing out thousands of pages a day. I'm sure that in a
    high-volume app that would be different.

    I prefer the all Tomcat solution myself where it fits (which would be
    most cases).

    But to respond to the OP:

    Apache is webserver only. Use it for HTML, SHTML, images, etc. With the
    exception of SSI, this is static stuff. For dynamic stuff (like PHP,
    Perl, Servlets, etc.) it needs help from other programs.

    Tomcat is a servlet container. Use it for JSP, Servlets (and if you
    want, all the stuff Apache does).

    JBoss is an application server. Use it if your application uses
    Enterprise JavaBeans.
     
    Tom Cole, Sep 6, 2006
    #6
  7. BIG BOY

    Mark Space Guest

    BIG BOY wrote:
    > Sir I am little bit confused about Apache Web Server and Apache Tomcat
    > Server. Please give me an link so that i can find it out.
    >


    I'm just gonna repeat what others have said.

    Apache = web server. I'm sure you know what that is.

    Tomcat is like Perl. Perl runs Perl scripts through CGI for Apache.
    Tomcat runs Java (servlets and JSP, but it's all Java) through CGI for
    Apache. Actually, Tomcat has a more sophisticated connection to Apache
    than CGI, but that's really just a detail of the implementation for this
    discussion. Fix in your mind that Tomcat = Java CGI, and you've got the
    basics.

    As others have mentioned, Tomcat also can be a stand-alone HTTP server,
    but it's not as robust or sophisticated as Apache. I'd only use Tomcat
    alone for testing, or for small internal web sites. For real production
    work, put Apache in front of Tomcat (just like you'd normally use Apache
    to run in front of Perl or other CGI scripting) and you're ready for the
    big leagues.
     
    Mark Space, Sep 6, 2006
    #7
  8. Tom Cole wrote:
    > Davide Consonni wrote:
    >> ok, but apache httpd is faster than tomcat and has a better virtual host
    >> management.
    >> usually people but tomcat behind apache with a connector ..

    >
    > Bet you can't find supporting data for that (usually people put tomcat
    > behind apache with a connector). My bet would be that most small to
    > mid-sized sites don't. I have situations with both (actually I have a
    > third scenario with IIS in front of Tomcat as well) and see no
    > significant difference in response times. Then again I'm only talking
    > about dealing out thousands of pages a day. I'm sure that in a
    > high-volume app that would be different.


    I would expect huge files to be sligthly faster in
    Apache or IIS than by Tomcat.

    Else the only reason for a speedup would be the
    use of HTTPS where Apache or IIS are using a hardware
    SSL accelerator.

    Arne
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Sep 6, 2006
    #8
  9. BIG BOY wrote:
    > Sir I am little bit confused about Apache Web Server and Apache Tomcat
    > Server. Please give me an link so that i can find it out.


    As others already have said then:

    Apache HTTPD = HTTP server
    Apache Tomcat = servlet container

    and you can run:

    --(HTTP)--HTTPD
    --(HTTP)--Tomcat
    --(HTTP)--HTTPD--(AJP)--TOMCAT

    at your choice.

    You can lookup docs at the Apache web site.

    The reasons for putting Apache in front of Tomcat
    are typical:
    - loadbalancing
    - need for non Java stuff like PHP
    - need for SSL hardware acceleration

    Arne
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Sep 6, 2006
    #9
  10. BIG BOY

    David Segall Guest

    "Tom Cole" <> wrote:
    >Tomcat is a ... and if you want, all the stuff Apache does.

    Is that really true? Can I use Tomcat as a front end for PHP, Perl
    etc? Does it have similar facilities for limiting access?
     
    David Segall, Sep 6, 2006
    #10
  11. BIG BOY

    Mark Space Guest

    David Segall wrote:
    > "Tom Cole" <> wrote:
    >> Tomcat is a ... and if you want, all the stuff Apache does.

    > Is that really true? Can I use Tomcat as a front end for PHP, Perl
    > etc? Does it have similar facilities for limiting access?


    I'm not an Apache expert, and I doubt Tomcat will really do *all* that
    Apache does. But Tomcat definitely has facilities for limiting user
    access based on user roles, and for hiding scripts and other back-end
    components from all users.
     
    Mark Space, Sep 6, 2006
    #11
  12. On 06.09.2006 18:58, Arne Vajhøj wrote:
    > I would expect huge files to be sligthly faster in
    > Apache or IIS than by Tomcat.


    Why do you expect that? I'd rather expect the opposite because the time
    for streaming a large file from disk to network is mostly determined by
    IO and network bandwidth whereas for smaller files the overhead of HTTP
    header processing etc. would make up a greater portion of overall
    timing. Are there any optimizations in apache (caching the whole file?)
    that will make it faster on large files?

    Kind regards

    robert
     
    Robert Klemme, Sep 7, 2006
    #12
  13. Robert Klemme wrote:
    > On 06.09.2006 18:58, Arne Vajhøj wrote:
    >> I would expect huge files to be sligthly faster in
    >> Apache or IIS than by Tomcat.

    >
    > Why do you expect that? I'd rather expect the opposite because the time
    > for streaming a large file from disk to network is mostly determined by
    > IO and network bandwidth whereas for smaller files the overhead of HTTP
    > header processing etc. would make up a greater portion of overall
    > timing. Are there any optimizations in apache (caching the whole file?)
    > that will make it faster on large files?


    My basis is practical. If Apache performs poorly for big
    files, then users complain and it get fixed. If Tomcat performs
    poorly for big files, then no users complain, because no users
    uses Tomcat for that, so it never get fixed.

    I did a simple test. One full size CD image. 10 downloads
    singlethreaded.

    Apache 2.0 - 155 seconds
    Tomcat 5.5 - 185 seconds

    Practically default config on both.

    It does not prove anything, because there are a bazillion
    possible test scenarios and test configs and not really
    a way to say what is most correct.

    But it did at least not prove my hypothesis wrong.

    Arne
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Sep 9, 2006
    #13
  14. BIG BOY

    manoj212077

    Joined:
    Sep 6, 2009
    Messages:
    5
    we can run php with tomcat without apche??????????????????????????
     
    manoj212077, Sep 19, 2009
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jakk
    Replies:
    4
    Views:
    12,233
  2. Christos Gravvanis
    Replies:
    0
    Views:
    2,051
    Christos Gravvanis
    Jul 7, 2004
  3. twins
    Replies:
    1
    Views:
    5,868
  4. Amit Jain
    Replies:
    6
    Views:
    534
    Amit Jain
    Nov 10, 2008
  5. The Poor
    Replies:
    2
    Views:
    237
    Gregory Toomey
    Sep 27, 2003
Loading...

Share This Page