Apache Webserver versus Apache Tomcat is a popular question,and being on the brink of choosing between the two,I started googling,but before I blog what i found,I just wanted to go over the bare basics of webservers,containers and HTTP.For the experienced ones,skip this and go directly to the differences :Apache Versus Tomcat
HTTP
Hypertext Transfer Protocol (HTTP) is a communications protocol used to transfer information on the web. HTTP is a request/response protocol between a client and a server. The client i.e. a web browser or some other end-user tool makes an HTTP request(called the User Agent)(http://www.google.com/ .The responding server which stores or creates resources such as HTML files and images—is called the origin server understands this request and returns the html content specified by the URL. There can be proxies, gateways and tunnels in between the client and the server, but ultimately the server receives and understands the request and sends the requested resources to the client.The server can return pure HTML content/HTML content with scripts embedded within which are understood by the client's web browser and executed on the client appropriately/files.
Typically, an HTTP client initiates a request by establishing a Transmission Control Protocol (TCP) connection to a particular port .An HTTP server listening on that port waits for the client to send a request message.
Upon receiving the request, the server sends back a status line, such as "HTTP/1.1 200 OK", and a message of its own, the body of which is perhaps the requested file, an error message, or some other information.
Resources to be accessed by HTTP are identified using Uniform Resource Identifiers (URIs) or Uniform Resource Locators (URL).
Web Server
A webserver is a piece of software that understands these HTTP requests,and is able to locate the resource that was requested,or atleast some component that will handle the request and return the resource.This is the basic functionality provided by any webserver.But on top of this,the webserver can also provide some services like: Authentication,handling static content and dynamic content(CGI,JSP,PHP,ASP e.t.c),HTTPS support(SSL or TLS) to allow secure encrypted connections to the server on the port 443 instead of 80,Content Compression,Virtual Hosting(Serve many websites using one IP address),Large File Support,Bandwidth throttling.
A basic HTTP webserver only understands HTTP,If we are programming in JSP's and servlets,we need something that understands Servlets and JSP's,the job of a Servlet Container is just that.Consider Apache HTTP Server and Apache Tomcat.The Apache HTTP Server like the name suggests acts as a webserver,Apache Tomcat acts as a webserver and can also understands servlets(A servlet container).So in order to use the Apache Webserver and let it serve jsp's and servlet's we can plug the Apache Tomcat Container into the Apache HTTP Server.
Friday, October 31, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment