2.3.2. Running a ZIP Installation


Running Tomcat version 5 or 6

After extracting the zip file, check to see if a user called tomcat exists on the system by running the following command:

id tomcat
Copy to Clipboard Toggle word wrap
If the user does not exist then it will need to be added, along with the appropriate usergroup. In order to achieve this, execute the following:
groupadd -g 91 -r tomcat
useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r -d /home/tomcat tomcat
Copy to Clipboard Toggle word wrap
Once this is completed, if the tomcat user will be running Tomcat, then the ownership of the tomcat directories will need to be changed to reflect this:
For Tomcat 5:
chown -R tomcat:tomcat tomcat5
Copy to Clipboard Toggle word wrap
For Tomcat 6:
chown -R tomcat:tomcat tomcat6
Copy to Clipboard Toggle word wrap
To test that the above commands have been successful, check that the tomcat user has execution permission to the tomcat install path.
The JAVA_HOME variable must now be set and this can be achieved by either modifying your .bashrc file or by modifying the Tomcat catalina.sh file.
If you chose to modify your .bashrc file, add the following line with the correct path to suit your systems configuration (a path is provided here as an example only):
export JAVA_HOME=/usr/lib/jvm/java
Copy to Clipboard Toggle word wrap
If you chose to modify your tomcat5/bin/catalina.sh or tomcat6/bin/catalina.sh file (depending on the version of Tomcat installed), add the following line with the correct path to suit your systems configuration (a path is provided here as an example only):
JAVA_HOME=/usr/lib/jvm/java
Copy to Clipboard Toggle word wrap
To start and stop Tomcat, execute the follwing scripts as the user tomcat:
To start Tomcat:
sh startup.sh
Copy to Clipboard Toggle word wrap
To stop Tomcat:
sh shutdown.sh
Copy to Clipboard Toggle word wrap
Once the Tomcat service has been started, you can verify that it is running by pointing your web browser to http://localhost:8080.
Running the HTTP Server

In order to run the HTTP Server, the distcache and pcre rpm packages must be installed as they are a requirement of mod_ssl. To check if these dependencies are already installed, execute the following in a command prompt:

rpm -q distcache pcre
Copy to Clipboard Toggle word wrap
The output will either say the rpms are not installed or it will display the package name followed by the version number. If distcache or pcre is not installed, execute:
for Red Hat Enterprise Linux 4:
up2date distcache
up2date pcre
Copy to Clipboard Toggle word wrap
For Red Hat Enterprise Linux 5:
yum install distcache
yum install pcre
Copy to Clipboard Toggle word wrap
While undertaking the install, you will be asked it you wish to proceed. When this occurs press the y key.
Once installation is complete run the following command in order to check that the package was installed successfully.
rpm -q distcache
rpm -q pcre
Copy to Clipboard Toggle word wrap
If the package was successfully installed then the output of the command will be the package name and the version number.
Now, after you have extracted the Enterprise Web Server zip file, change into the httpd directory and run the post install script by executing the following:
./.postinstall
Copy to Clipboard Toggle word wrap
Check to see if a user called apache exists on the system by running the following command:
id apache
Copy to Clipboard Toggle word wrap
If the user does not exist then it will need to be added, along with the appropriate usergroup. In order to achieve this, execute the following:
groupadd -g 91 -r apache 2> /dev/null || :
useradd -c "Apache" -u 91 -g apache -s /bin/sh -r -d /home/apache apache 2> /dev/null || :
Copy to Clipboard Toggle word wrap
Once this is completed, if the apache user will be running the httpd service, then the ownership of the HTTP directories will need to be changed to reflect this:
chown -R apache:apache httpd
Copy to Clipboard Toggle word wrap
To test that the above commands have been successful, check that the apache user has execution permission to the HTTP server install path.
Start the HTTP server by changing to the httpd directory and executing:
su -m -c "./sbin/apachectl start"
Copy to Clipboard Toggle word wrap
Stop the HTTP server by executing:
su -m -c "./sbin/apachectl stop"
Copy to Clipboard Toggle word wrap
Running the mod_jk

To load the mod_jk module, the file httpd/conf/httpd.conf needs to be updated, and a workers.properties file needs to be added in that directory. See doc/mod_jk/mod_jk.conf.sample and doc/mod_jk//workers.properties.sample for examples of how this can be achieved.

Running Apache Tomcat Native

The native library for Tomcat 6 is setup to be used by default, with the LD_LIBRARY_PATH and -Djava.library.path having been set accordingly within the catalina.sh file.

For Tomcat 6, start the service and check that you see a message similar to:
Feb 8, 2008 12:27:41 PM org.apache.catalina.core.?AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.x.y.
Feb 8, 2008 12:27:41 PM org.apache.catalina.core.?AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Feb 8, 2008 12:27:41 PM org.apache.coyote.http11.?Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Copy to Clipboard Toggle word wrap
For Tomcat 5, start the service and if the tomcat native library is not used, a message similar to the one below will appear:
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
Copy to Clipboard Toggle word wrap
Running log4j for logging in a zip installation of Tomcat 6

In order to use log4j logging in Tomcat 6, copy the content of the extras/ directory into the lib/ directory and restart Tomcat.

Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat