Archive

Archive for the ‘Tomcat’ Category

Tomcat Primer

September 18, 2009 1 comment

 

  

Tomcat Logo

 

 

 

Apache Origin:

Apache Tomcat (or Jakarta Tomcat or just Tomcat) is an open source servlet container started out as a reference implementation by Sun Microsystems and donated to the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a “pure Java” HTTP web server environment for Java code to run. Tomcat should not be confused with the Apache web server, which is a C implementation of an HTTP web server; these two web servers are not bundled together. Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files.

Members of the ASF and independent volunteers develop and maintain Tomcat. Users have free access to the source code and to the binary form of Tomcat under the Apache License and hence is freely downloadable. The initial Tomcat release appeared with versions 3.0.x. Tomcat 6.0.20 is the latest production quality release of the 6.0.x trunk (based on 2.5 servlet specification).

Tomcat started off as a servlet reference implementation by James Duncan Davidson, a software architect at Sun Microsystems. He later helped make the project open source and played a key role in its donation by Sun to the Apache Software Foundation.

 

Tomcat Introduction:

Tomcat is a Java Servlet/JSP container and web server from the Jakarta project of the Apache software foundation. A web server dishes out web pages in response to requests from a user which typically is a web browser. But web servers are not limited to serving up static HTML pages; they can also run programs in response to user requests and return the dynamic results to the user’s browser. Tomcat is very good at this because it provides both Java servlet and JavaServerPages (JSP) technologies (in addition to traditional static pages and external CGI programming). Tomcat can be used as either a standalone product with its own internal Web server or together with other Web servers, including Apache, Netscape Enterprise Server, Microsoft Internet Information Server (IIS), and Microsoft Personal Web Server where the traditional server can be used to serve static pages and Tomcat can be used to serve dynamic servlet and JSP requests.

Tomcat is one of several open source collaborations called Jakarta. Tomcat requires a Java Runtime Enterprise Environment that conforms to JRE 1.1 or later. Developed under the Apache license in an open and participatory environment, Tomcat is intended to be a collaboration of the best-of-breed developers from around the world.

 

Some of the Tomcat and related definitions:

Apache:
“The Apache software foundation provides support for the Apache community of open-source software projects. The Apache projects are characterized by a collaborative, consensus based development process, an open and pragmatic software license, and a desire to create high quality software that leads the way in its field.” Amongst the projects that come under the “Apache” banner are the HTTP Web Server from which the whole Apache project has grown, and which is the container used for the majority of web sites worldwide, Ant (a build tool which allows the developer excellent control of the compiling and bundling processes), and Jakarta.

Jakarta:
“The Jakarta Project creates and maintains open source solutions on the Java platform for distribution to the public at no charge. Jakarta products are developed by and distributed through various sub-projects.” Jakarta is the name for the Apache project which deals with the provision of open source additions in Java. More than 20 such additions (known as sub-projects) are listed on their web site, including Struts and Tomcat.

Tomcat:
Tomcat is a servlet container for the Java Servlets and JavaServer Pages. It provides a Java Virtual Machine and associated elements to give a complete Java Runtime Environment, and it also provides web server software to make that environment accessible on the Web. Configuration and management tools are also provided, with configuration data largely held in XML. It’s worth noting that Tomcat is much more than just an implementation of Servlets and JSPs, it’s the official reference implementation and the standard against which all other suppliers of containers for Servlets and JSPs must measure their products. It means that developers know that if they develop code that works under Tomcat, that code should work under other containers that conform to the standards set.

 

 

Tomcat Architecture: Read more…

Advertisements

Why Tomcat?

September 16, 2009 Leave a comment

 

 

Why Webserver?

Have you ever wondered about the mechanisms that delivered this page to you? So, when you clicked on the link for this page, or typed its URL (Uniform Resource Locator), what happened behind the scenes to bring this page onto your screen? If you’ve ever been curious about the process, or have ever wanted to know some of the specific mechanisms that allow you to surf the Internet, then read on. At the most basic level possible, the following diagram shows the steps that brought that page to your screen:

 

 

 

webserver-basic

 

 

The browser breaks the URL into three parts:

  • The protocol (“http”)
  • The server name (“www.tecneosis.com“)
  • The file name (“why-tomcat.htm”)

The browser communicates with a name server to translate the server name “www.tecnoesis.com” into an IP Address, which then the browser uses to connect to the server machine. The browser then forms a connection to the server at that IP address on port 80. Following the HTTP protocol, the browser sends a GET request to the server, asking for the file “http://www.tecnoesis.com/why-tomcat.htm.” The server then sends the HTML text for the Web page to the browser. The browser reads the HTML tags and formats the page onto your screen. Your browser forms a connection to a Web server, requests a page and receives it.

 

Clients and Servers:

In general, all of the machines on the Internet can be categorized as two types: servers and clients. Those machines that provide services (like Web servers or FTP servers) to other machines are servers. And the machines that are used to connect to those services are clients. When you connect to Yahoo! at www.yahoo.com to read a page, Yahoo! is providing a machine (probably a cluster of very large machines),to service your request. Yahoo! then is a server. Your machine, on the other hand, is a user machine also known as a client.

The server usually serves either static or dynamic pages to the client. Static pages are those that do not change unless the creator of the page edits it. Dynamic pages are those which the server has to perform certain processes (invoke the component that executes perticular logic) to dynamically display the content to the client.

 

Tomcat as a Webserver: Read more…

Tomcat Installation & Configuration

 

 

At the time of this post, the latest stable version available form Apache Tomcat is 6.0.x. Older releases of Tomcat can be found on download section of http://tomcat.apache.org/. Apache Tomcat version 6.0 implements the Servlet 2.5 and JavaServer Pages 2.1 specifications from the Java Community Process, and includes many additional features that make it a useful platform for developing and deploying web applications and web services.

 

Different versions of Apache Tomcat are available for different versions of the Servlet and JSP specifications. The following table shows the dependancies:

 

Servlet/JSP Spec Apache Tomcat version
2.5/2.1 6.0.x
2.4/2.0 5.5.x
2.3/1.2 4.1.x
2.2/1.1 3.3.x (archived)

 

  

Before downloading Tomcat, you might want to know about the different releases available from Apache:

  • Alpha releases may contain large amounts of untested/missing functionality required by the specification and/or significant bugs and are not expected to run stably for any length of time.
  • Beta releases may contain some untested functionality and/or a number of relatively minor bugs. Beta releases are not expected to run stably.
  • Stable releases may contain a small number of relatively minor bugs. Stable releases are intended for production use and are expected to run stably for extended periods of time.

 

Pre-requisites:

Tomcat requires Java to be installed on your computer to run. Make sure you have a recent Java version installed and JAVA_HOME variable to be set. Note: Refer to Java Installation and configuration post for details. After setting the JAVA_HOME environment variable, you can install tomcat.

 

Download Instructions: Read more…