Why Apache when Tomacat can do

Discussion in 'Java' started by parkarumesh@gmail.com, Mar 6, 2006.

  1. Guest

    Tomcat is a container and can also function as a web server, then why
    on eath do we requier Apache Web Server, why do we need two, when one
    can serve the purpose.
     
    , Mar 6, 2006
    #1
    1. Advertising

  2. James McGill Guest

    Tomcat doesn't "require" Apache, but it allows it via mod_jk. It can
    connect to other servers for the protocol handling if you wanted it to.
    That's the whole point of being modular.

    Apache can certainly outperform Tomcat. Think of the case where you get
    a high volume of regular http traffic but a relatively low volume of
    dynamic stuff served by java. It's the difference between expecting
    Tomcat to do all the work, or letting Apache take most of it.
     
    James McGill, Mar 6, 2006
    #2
    1. Advertising

  3. Adam Maass Guest

    <> wrote:
    > Tomcat is a container and can also function as a web server, then why
    > on eath do we requier Apache Web Server, why do we need two, when one
    > can serve the purpose.
    >


    Apache makes better use of available bandwidth when there are long latencies
    involved than Tomcat does. Basically, it's better at serving static content
    than Tomcat.

    -- Adam Maass
     
    Adam Maass, Mar 6, 2006
    #3
  4. robert Guest

    Adam Maass escreveu:

    > <> wrote:
    > > Tomcat is a container and can also function as a web server, then why
    > > on eath do we requier Apache Web Server, why do we need two, when one
    > > can serve the purpose.
    > >

    >
    > Apache makes better use of available bandwidth when there are long latencies
    > involved than Tomcat does. Basically, it's better at serving static content
    > than Tomcat.
    >
    > -- Adam Maass


    There's also the Apache Portable Runtime (APR) which has the static
    content advantages without mod_jk:

    http://tomcat.apache.org/tomcat-5.5-doc/apr.html

    "When APR is enabled, the HTTP connector will use sendfile for hadling
    large static files (all such files will be sent ansychronously using
    high performance kernel level calls), and will use a socket poller for
    keepalive, increasing scalability of the server. "

    The apr uses shared libraries built for the native system - I had to
    compile from source on linux to get it to work right.

    HTH,
    Robert
    http://www.braziloutsource.com/
     
    robert, Mar 6, 2006
    #4
  5. Apache is designed for being a static-content web server. It fully
    understands type-maps for mapping Content-type to a file type. It also
    is much better than Tomcat for mapping specific file-system directories
    to URLs and for excluding access to certain directories. You can also
    easily use a single instance of Apache to front-end multiple web-sites
    and select the correct set of web pages to display based on request
    URL. Tomcat of course is more suited for dishing up dynamic content. It
    is fine for a simple web site but for a large web site with a mix of
    static and dynamic content you are better off to have Apache front-end
    all the static content and hand off the dynamic pages to Tomcat.
     
    scottwerden at G Mail dot com, Mar 6, 2006
    #5
  6. robert Guest

    scottwerden at G Mail dot com escreveu:

    > Apache is designed for being a static-content web server. It fully
    > understands type-maps for mapping Content-type to a file type. It also
    > is much better than Tomcat for mapping specific file-system directories
    > to URLs and for excluding access to certain directories. You can also
    > easily use a single instance of Apache to front-end multiple web-sites
    > and select the correct set of web pages to display based on request
    > URL. Tomcat of course is more suited for dishing up dynamic content. It
    > is fine for a simple web site but for a large web site with a mix of
    > static and dynamic content you are better off to have Apache front-end
    > all the static content and hand off the dynamic pages to Tomcat.


    My point was that with the apr, my understanding is that it uses native
    os calls via a JNI wrapper for static content. I've also used mod_jk
    and my inclination is that since apr is simpler to configure I need to
    see a compelling reason to use apache. Doesn't the apr largely nullify
    the static content argument ?

    That does not however impact your points concerning directory mapping
    flexibility and fronting multiple web sites. I'm talking strictly about
    static content and the apr vs configuring apache and mod_jk (or
    mod_jk2, etc). And by static content I'm referring to many large gifs,
    etc at the root of the war.

    Robert
    http://www.braziloutsource.com/
     
    robert, Mar 6, 2006
    #6
    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. Replies:
    0
    Views:
    994
  2. Replies:
    2
    Views:
    13,899
  3. Replies:
    4
    Views:
    647
    Joseph Kesselman
    Aug 10, 2006
  4. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    985
    Mark Rae
    Dec 21, 2006
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,237
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page