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.
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.
I assume, you
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
for download install build and so on.
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 |
NOTE: To avoid errors, make sure that there are no spaces in the path name if you want to use JSP.
unpack the distrib to any convenient place. You should use the convention to unpack under the folder
c:\programs\tomcat
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"
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.
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:
<Server port="8005" shutdown="SHUTDOWN" debug="0"> |
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 9011 --> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8080" minProcessors="5" maxProcessors="75" |
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8009" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="0" useURIValidationHack="false" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/> <!-- Define an AJP 1.3 Connector on port 8009 --> <!-- <Connector className="org.apache.ajp.tomcat4.Ajp13Connector" port="8009" minProcessors="5" maxProcessors="75" acceptCount="10" debug="0"/> --> |
<!-- anything except 2 consecutive '-' signs --> |
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
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.
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.
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
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
catalina.out
.localhost_log.<date>.txt
. You should get a clue by now.catalina.out
and look for following pattern:
[INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalonel Apache Tomcat/4.1.18 |
http://localhost:8080 |