Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic question 1

Status
Not open for further replies.

royc75

Programmer
Jun 1, 2006
127
GB
Hello,

Basic question: What is the difference between the Tocal and the Apache Server and what is the reletionships between them? If I have tomcat I also have Apache?
 
Hi

Tomcat is a Java servlet container. A poor one. ( Not my comment. ) It runs a Java application with a special structure and serves the resulted documents over HTTP protocol. Can also serve static and CGI generated documents, but its performance is not so good for this.

Apache is a web server. The best. It serves static and CGI generated documents over HTTP protocol.

Tomcat can run alone, but is a widespread usage to put it under an Apache.

And no, you do not get any of them only by installing the other. Both are independent servers.

Feherke.
 
Thank you Feherke for the clear explanation.
But if Apache is a web server can't it handle JSPs ans Servlets on it's own?
If yes, than why do I need tomcat for and why it is a widespread usage to put it under an Apache?
If no, than what is the Apache's benefits?
 
Hi

royc75 said:
But if Apache is a web server can't it handle JSPs ans Servlets on it's own?
No. The HTTP protocol is stateless and each request is handled separately. This leads to waste of resources. The idea of Java servlets and servlet containers is to eliminate as much as possible this kind of wastes. So the application server is a Java application and the servlets are loaded and handled somehow like plug-ins. So servlets are not stand-alone applicatons and are not able to run outside the servlet container.
royc75 said:
If no, than what is the Apache's benefits?
To run a servlet, Tomcat must be written in Java. Apache is written in C which is faster.
The servlets are more independent and do not need so much customization and support from the server, contrarily Apache has better support for CGI, SSI, HTTP authentication and others.
Beside this, Apache has better support for virtual hosts, user homes, per directory configuration, etcetera. And of course has much more modules then Tomcat.

Belive me, Tomcat and Apache are not the same category, as it looks at the first sight.

Feherke.
 
Ok, so now that I understand this point I must ask:
1. What is the topology of tomcat and Apache build together? I mean, when I write a Servlet and deploy it to the tomcat and a user requests it, I know the process order when tocat handles the request, what is the process order when Apache is in the picture.
2. Is it correct to say the Apache should be put in front of the tomcat, like a filter or something?
3. How hard is it to combine these two together and where can I download Apache from and get a reference for this combination?

 
Hi

Forgot in my previous post : Apache has better security then Tomcat.
royc75 said:
What is the topology of tomcat and Apache build together?
Sorry, I can not help in this. I never used them that way.

As far as I know, all requests goes to Apache then it forwards the Java servlet requests to Tomcat and serves the static documents ( image, JavaScript, style sheet ) itself.
royc75 said:
where can I download Apache from
Go here and select a mirror, then you get it :


royc75 said:
get a reference for this combination
Not sure, but I think this is :


Feherke.
 
Thank you Feherke for all the information.
The problem is that since Apache process only static document it has no benefit when it comes to dynamic one. Now, every web site has dynamic content. In fact, most of the content today is not static. So who uses it? Only web sites who has HTML/Javascript documents?
 
Hi

royc75 said:
In fact, most of the content today is not static. So who uses it? Only web sites who has HTML/Javascript documents?
No. Dynamic content can be produced with CGI scripts too ( Perl and PHP the most commonly used ), and SSI ( for example my site ), or other processing mechanism ( like Escapade ). All this are better handled by Apache then by Tomcat.

61.25 % of the world's web servers are Apache. ( According to NetCraft .) Then are other popular web servers. No, this is not the servlet container's time yet. And I would say that will never be.

Feherke.
 
Wow you are sceptic as it comes to sevlet continers... :) But since I am not familiar with the other techniques you have mentioned I'll take your word for it. Thank you again for taking the time to explain all this, I really appreciate it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top