2.3.2. Running a ZIP Installation
After extracting the zip file, check to see if a user called tomcat exists on the system by running the following command:
id tomcat
id tomcat
groupadd -g 91 -r tomcat useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r -d /home/tomcat tomcat
groupadd -g 91 -r tomcat
useradd -c "Tomcat" -u 91 -g tomcat -s /bin/sh -r -d /home/tomcat tomcat
tomcat user will be running Tomcat, then the ownership of the tomcat directories will need to be changed to reflect this:
chown -R tomcat:tomcat tomcat5
chown -R tomcat:tomcat tomcat5
chown -R tomcat:tomcat tomcat6
chown -R tomcat:tomcat tomcat6
tomcat user has execution permission to the tomcat install path.
JAVA_HOME and CATALINA_HOME variables will now need to be set and this can be achieved by either modifying your .bashrc file or by modifying the Tomcat catalina.sh file.
.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 export CATALINA_HOME=<insert_install_path>/tomcat5 #(or tomcat6)
export JAVA_HOME=/usr/lib/jvm/java
export CATALINA_HOME=<insert_install_path>/tomcat5 #(or tomcat6)
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 CATALINA_HOME=<insert_install_path>/tomcat5 #(or tomcat6)
JAVA_HOME=/usr/lib/jvm/java
CATALINA_HOME=<insert_install_path>/tomcat5 #(or tomcat6)
tomcat:
sh startup.sh
sh startup.sh
sh shutdown.sh
sh shutdown.sh
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
rpm -q distcache pcre
up2date distcache up2date pcre
up2date distcache
up2date pcre
yum install distcache yum install pcre
yum install distcache
yum install pcre
y key.
rpm -q distcache rpm -q pcre
rpm -q distcache
rpm -q pcre
httpd directory and run the post install script by executing the following:
./.postinstall
./.postinstall
apache exists on the system by running the following command:
id apache
id apache
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 || :
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 || :
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
chown -R apache:apache httpd
apache user has execution permission to the HTTP server install path.
sbin directory and executing:
LD_LIBRARY_PATH=<insert_install_path>/httpd/lib ./httpd -f install_path/httpd/conf/httpd.conf -E install_path/httpd/logs/httpd.log -k start
LD_LIBRARY_PATH=<insert_install_path>/httpd/lib ./httpd -f install_path/httpd/conf/httpd.conf -E install_path/httpd/logs/httpd.log -k start
LD_LIBRARY_PATH=<insert_install_path>/httpd/lib ./httpd -f install_path/httpd/conf/httpd.conf -E install_path/httpd/logs/httpd.log -k stop
LD_LIBRARY_PATH=<insert_install_path>/httpd/lib ./httpd -f install_path/httpd/conf/httpd.conf -E install_path/httpd/logs/httpd.log -k stop
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.
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.
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
In order to use log4j logging in Tomcat 6, copy the content of the extras/ directory into the lib/ directory and restart Tomcat.