This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
You don't need to install Apache to get started with Tomcat.
Apache is a web server and Tomcat is JavaServlet container. This means Apache simply sends back an http messages containing files (html pages, jpgs, etc.) or runs simple scripts and sends the output from these scripts back in the http message.
Tomcat can perform the same functions but in addition it will also run Java programs (known as Servlets) and process JSPs. JSPs are files containing JSP tags, or instructions, that Tomcat will execute in order to produce a plain html file that can be sent to the users browser for viewing. Tomcat gives you Java in your html pages and the ability to run Java programs.
However, Tomcat can also serve all the different types fo files that Apache serves.
When you install and run Tomcat you access the home page using something like http://localhost:8080/. This indicates to your browser that server you want to talk to is listening on port 8080. Apache usually listens on port 80 which is the default port for http. When you get to the Tomcat homepage you can read the Tomcat documentation.
When you're comfortable with Tomcat and have explored JSP and written some servlets you might want to try using Tomcat in tandem with Apache. The optimal set-up is to use Apache to process all the standard web components (plain html files, image files, etc) and to forward requests for JSPs and Java Servlets on to Tomcat. There a lots of advantages to this set-up. Let me know if you need some help getting Tomcat and Apache working as it took me a while to figure it out the first time.
This is a brief description and the truth and Apache and Tomcat is much deeper than I've described here but hopefully this have given you enough information to dive and try Tomcat!
Joined: Mar 04, 2005
Thank you so much, Andrew. You gave a very detailed, comprehensive and clear answer to my question. Now I have a more clear picture about Apache HTTP Server and Tomcat. Thnx for your help!!!