Why Apache when Tomacat can do

P

parkarumesh

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.
 
J

James McGill

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.
 
A

Adam Maass

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
 
R

robert

Adam Maass escreveu:
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/
 
S

scottwerden at G Mail dot com

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.
 
R

robert

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/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top