installing tomcat in 15 minutes (cookbook approach for windows)

- TARGET-AUDIENCE: beginners
- COCOON-RELEASES: n.a
- DOCUMENT-STATUS: *draft* reviewed released


This document applies to :

Warning: many pages on this wiki imply that a servlet container must be installed before running Cocoon, this is wrong - see NoServletContainerRequired. A basic installation of Cocoon for test or development purposes can be very simple.

What you will get from this page

You will learn, how to retrieve and setup tomcat, the official reference ServletContainer. This approach has been tested with tomcat 4.1.18 and newer releases.

Your basic skills

I assume, you

Technical prerequisites

In order to install tomcat you need

For general infos about installation of tomcat refer to the official Tomcat site. See
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/RUNNING.txt

Step I: Get the distrib

Retrieve the current distribution from
http://apache.serveftp.org/apache-site/dist/jakarta/tomcat-4/binaries/

On the distribution directory you will find several tomcat packages suitable for different operating systems. You would retrieve the .exe version, which comes along with a nice and easy to use install shield. If you want to use winzip, you also can download the zip distribution.

caveat: Make shure, which java version you have installed. If you are running the Java-1.4 runtime or JDK, please retrieve one of the tomcat distributions, which are clearly labeled with jdk14. If you are running a lower version of java, you must download one of the other distributions. You can check from a DOS-Box which java version you are running by issuing the following command:

 java -version 

Step II: Unpack it (if you use the zip-distrib)

NOTE: To avoid errors, make sure that there are no spaces in the path name if you want to use JSP.

unpack the zip-distribution

unpack the distrib to any convenient place. You should use the convention to unpack under the folder

c:\programs\tomcat

install the installshield based exe-version

you may simply call this exe file now. An installer will open up. You may complete the installing process with the given defaults. At the end your tomcat server is ready to operate and you can start it from the start menu

Start -> Programs -> Apache Tomcat 4.* -> Start Tomcat

You are ready with the installation. You may continue at the paragraph "startup Tomcat for the forst time"

Step III: Prepare for startup (only zip-distrib)

Once you have installed tomcat, you need to prepare it for startup. I recommend to try first starting the distribution as is. You only need to modify something, if the following ports are already occupied by some other program:

||8005||Shutdown port for maintenance ||8080||Standard http port ||8009||standard port for connection to a webserver

Please note, that your tomcat server comes with an included http-server. So you don't need a webserver like the apache-server to run your servlets. You simply start tomcat, then you are ready to access it from your browser.

modify the standard port settings

As pointed out above, you need to do this only, if you are shure, that the Tomcat standard ports are already occupied. If you are unshure, just start Tomcat and check for errors telling about "Adress already bound"-messages. If this occurs, come here and do the following:

Start your container for the first time

installed exe-version:

from the start menu

Start -> Programs -> Apache Tomcat 4.* -> Start Tomcat

zip-distribution:

Enter the subfolder named "c:\programs\tomcat\bin" of your distribution. You will find a set of usefull batch files:

||catalina.bat || best for manual startup from commandline ||startup.bat || best for script based startup ||shutdown.bat || best for script based shutdown

You may use catalina.bat for the beginning:

cd C:\ptograms\tomcat\jakarta-tomcat-4.1.16\bin
./catalina.bat

You have started tomcat now in foreground. The shell is blocked and tomcat runs. You can stop tomcat by pressing CTRL-C at any time.

An alternative way is to use ./startup.bat instead of ./catalina.bat This would start tomcat in the background sending the screen output into a logfile instead. To stop tomcat in background mode, use the batch file shutdown.bat

Verify operation

Once you have started tomcat, you can use your Browser to access the Welcome page. Assuming you have not modified the server.xml as described above, you may now access Tomcat by typing in your browser:

http://localhost:8080

You might have to replace localhost by the name of your server if your browser runs on a different machine. If you see the Tomcat welcome message, chances are very high, that your installation was correct. If you don't see anything see below.

Where to go next

Now you have managed to install the Tomcat Servlet Container. You have verified, that your container operates in your environment. Now it's time to get cocoon into play. I propose following documents:

BeginnerInstallation: We will show you, how you can setup cocoon within your new Servlet Container.

First aid if something goes wrong.

There is always the chance, that something goes wrong during setup. The most critical part of the installation is the modification of the file $tomcat_root\conf\server.xml

Look at the startup logs

You will find the logs under $tomcat_root/logs This is a typical list of logfiles, you may find:

catalina.out
localhost_log.2003-01-15.txt
catalina_log.2003-01-14.txt
localhost_admin_log.2003-01-14.txt
localhost_examples_log.2003-01-14.txt


page metadata

- AUTHOR: Hussayn Dabbous
- AUTHOR-CONTACT: mailto:hussayn.dabbous@saxess.com[[BR]] - REVIEWED-BY:
- REVIEWER-CONTACT:[[BR]]

BeginnerInstallTomcatWindows (last edited 2009-09-20 23:41:52 by localhost)