{"id":130,"date":"2007-07-31T08:04:07","date_gmt":"2007-07-31T07:04:07","guid":{"rendered":"https:\/\/www.purple-penguin.org\/blog\/?p=130"},"modified":"2007-07-31T08:06:23","modified_gmt":"2007-07-31T07:06:23","slug":"howto-install-tomcat-5-on-centos-4","status":"publish","type":"post","link":"https:\/\/www.purple-penguin.org\/blog\/2007\/07\/31\/howto-install-tomcat-5-on-centos-4\/","title":{"rendered":"Howto install Tomcat 5 on CentOS 4"},"content":{"rendered":"<p><strong>Howto install  tomcat 5 on CentOS 4<\/strong><\/p>\n<p><strong>This has been taken from serral online instruction and combinded with pritical IT Works \ud83d\ude42<\/strong><\/p>\n<p>This howto is assuming that you have a working, minimal installation of CentOS.  I will repeat that because if not properly understood it will cause you lots of headaches later.  A <strong>MINIMAL<\/strong> installation of CentOS.  This means that when you are doing your installation, you should scroll to the bottom and check that pretty little box that says  &#8220;minimal&#8221; so that only the bare essentials are installed.  We will let yum take care of the rest.<\/p>\n<p>title=&#8221;Setting_up_jpackage.org_Enviroment&#8221; name=&#8221;Setting_up_jpackage.org_Enviroment&#8221;&gt;<\/p>\n<h2>Setting up jpackage.org Enviroment<\/h2>\n<p>Steps<\/p>\n<pre>   * Install 'jpackage-utils' (if not already in your system)\r\n\r\n   * Install at least one JDK\r\n\r\n   * Subscribe your system to a repository and install the package you want (dependencies will be brought in automatically)<\/pre>\n<p>jpackage-utils<\/p>\n<p>Most Linux distributions now ship with a jpackage-utils RPM installed. If yours doesn&#8217;t, you can obtain this RPM using Repoview or the JPackage repository browser. YOU MUST HAVE A &#8216;jpackage-utils&#8217; RPM INSTALLED ON YOUR SYSTEM BEFORE INSTALLING A JDK. JDK<\/p>\n<p>Due to different licensing conditions, we only provide nosrc RPMS for the JDKs, or a &#8216;-compat&#8217; RPM for the Sun JDKs. BEA and IBM provide us with the specifications for their JDKs RPMs, which are JPP compliant. We make them available as nosrc RPMs. The RPM on the Sun web site requires that a corresponding &#8216;-compat&#8217; RPM from JPackage be installed to become compatible, or alternatively one can also rebuild a nosrc RPM for it.<\/p>\n<p>YOU MUST HAVE AT LEAST ONE JDK INSTALLED BEFORE INSTALLING ANY OTHER JAVA PACKAGE.<\/p>\n<p>ATTENTION: Please install (at least) _both_ the java-&lt;version&gt;-&lt;provider&gt; _and_ the java-&lt;version&gt;-&lt;provider&gt;-devel for a complete SDK.<\/p>\n<p>(the &#8216;java-&lt;version&gt;-sun-compat&#8217; provides everything for the Sun JDK case, so there is no -devel). Notes<\/p>\n<p>If the -compat RPM for the latest Sun release is not yet available, you can request an update via the mailing list.<\/p>\n<p>If the current Sun JDK is not yet packaged, you can find archived releases here.<\/p>\n<p>For information on building one of the nosrc JDK RPMs from either Sun, BEA or IBM, please see Rebuilding nosrc RPMs Installing the Sun JDK using the &#8216;-compat&#8217; method<\/p>\n<p>This step is only necessary if you want to avoid rebuilding the nosrc JDK RPM. Please note that rebuilding the nosrc RPM is the preferred method of obtaining a JPackage JDK.<\/p>\n<p><strong>repo setup<\/strong><\/p>\n<p>The first thing that we have to do is set up out yum repositories so that we can find the packages to be downloaded.  The jpackage repository makes this very easy and we will install this one first.  All of the repositories are located in the \/etc\/yum.repos.d directory.  To install the repository for jpackage, which contains all of the java goodies, simply:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>cd \/etc\/yum.repos.d<\/strong><strong>wget -P \/etc\/yum.repos.d <a href=\"http:\/\/jpackage.org\/jpackage.repo\" class=\"external free\" title=\"http:\/\/jpackage.org\/jpackage.repo\" rel=\"nofollow\">http:\/\/jpackage.org\/jpackage.repo<\/a><\/strong><\/td>\n<\/tr>\n<\/table>\n<p>Edit the jpackage.repo file you retrieved and enable the repositories appropriate to your distribution.  In the case of CentOS I set<br \/>\n<em>enabled=1<\/em> on the <em>jpackage-rhel<\/em> sections.<\/p>\n<p>The JPackage RPMs are digitally signed using a GPG key, import their key into your RPM keyring<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>rpm &#8211;import <a href=\"http:\/\/jpackage.org\/jpackage.asc\" class=\"external free\" title=\"http:\/\/jpackage.org\/jpackage.asc\" rel=\"nofollow\">http:\/\/jpackage.org\/jpackage.asc<\/a><\/strong><\/td>\n<\/tr>\n<\/table>\n<p>Before adding new stuff make shoure your installed rpms are up to date<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>yum update<\/strong><\/td>\n<\/tr>\n<\/table>\n<h2> Get the jdk<\/h2>\n<p>Next, since Sun does not make available its jdk via yum, you have to go to the sun site and download it.  If you point your browser over to:<\/p>\n<p><strong><a href=\"http:\/\/java.sun.com\/javase\/downloads\/index.jsp\" class=\"external free\" title=\"http:\/\/java.sun.com\/javase\/downloads\/index.jsp\" rel=\"nofollow\">http:\/\/java.sun.com\/javase\/downloads\/index.jsp<\/a><\/strong><\/p>\n<pre>  1.<\/pre>\n<pre>     Get the Sun JDK 5.0 from:<\/pre>\n<pre>     <a href=\"http:\/\/java.sun.com\/javase\/downloads\/index.jsp\" class=\"external free\" title=\"http:\/\/java.sun.com\/javase\/downloads\/index.jsp\" rel=\"nofollow\">http:\/\/java.sun.com\/javase\/downloads\/index.jsp<\/a><\/pre>\n<pre>     by choosing the \"JDK 5.0 Update N\" \"Download\" button, and then choosing \"RPM in self-extracting file\" for Linux on the page that displays after pressing the button.\r\n\r\n     Important: Do NOT install the \"Linux x64\" version of the SDK.<\/pre>\n<pre>     If you prefer the older Java 1.4.2 SDK, get it from:<\/pre>\n<pre>     <a href=\"http:\/\/java.sun.com\/j2se\/1.4.2\/download.html\" class=\"external free\" title=\"http:\/\/java.sun.com\/j2se\/1.4.2\/download.html\" rel=\"nofollow\">http:\/\/java.sun.com\/j2se\/1.4.2\/download.html<\/a><\/pre>\n<pre>     by choosing the \"Download J2SE SDK\" link and from there the \"RPM in self-extracting file\" for Linux.<\/pre>\n<p>You can download the one you see fit.  I downloaded JDK 5.0 Update 12, which at the time of this howto was the current one.  When you see the Sun download page, accept the agreement and pick the &#8220;Linux RPM in self-extracting file&#8221;  (the one that ends in rpm.bin).<\/p>\n<p>When your Sun JDK <strong>Linux RPM self-extracting file<\/strong> finally arrives you need to execute it, since it is a shell script. It contains the license agreement and the compressed RPM package with Sun JDK. It will ask you if you agree to the long license. Say yes, then it will uncompress the RPM with JDK, and then it will install it. To run it do:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>chmod 755 jdk-1_5_0_12-linux-i586-rpm.bin<br \/>\n.\/jdk-1_5_0_12-linux-i586-rpm.bin<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>Unfortunately, the Sun RPM package puts files in different locations than the ones required by CentOS. After running the script you will see a new directory \/usr\/java\/jdk1.5.0_07 with JDK files. Note that the actual RPM is left in the directory where you ran the Sun\u00e2\u20ac\u2122s jdk-1_5_0_07-linux-i586-rpm.bin script, however, you do not need to process the RPM, since script already did it.<\/p>\n<p>You may, however, use the RPM package if you want to install the JDK on another machine or if you erased the JDK at some point with a the RPM\u00e2\u20ac\u2122s rpm -e jdk-1.5.0_07-fcs command. Now, we are ready to install the SUN JDK compatibility RPM from the JPackage.org<\/p>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h2>Install compatibility RPM<\/h2>\n<p>Install java-1.4.2-sun-compat or java-1.5.0-sun-compat, download it your self as the yum install tends to pick up the wrong version.<\/p>\n<p>Download and install the appropriate -compat RPM from JPackage at:<\/p>\n<pre>     <strong><a href=\"ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/\" class=\"external free\" title=\"ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/\" rel=\"nofollow\">ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/<\/a><\/strong><\/pre>\n<p>Make sure to match the version of the -compat package to the SDK you&#8217;ve installed in the first step. The -compat RPM requires that the RPM self-extracting file from Sun be used in the previous step, not the plain (non-RPM) one.<\/p>\n<pre> For instance, for a Sun SDK 1.5.0_12 you should get:<\/pre>\n<pre> <a href=\"ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/java-1.5.0-sun-compat-1.5.0.12-1jpp.i586.rpm\" class=\"external free\" title=\"ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/java-1.5.0-sun-compat-1.5.0.12-1jpp.i586.rpm\" rel=\"nofollow\">ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/java-1.5.0-sun-compat-1.5.0.12-1jpp.i586.rpm<\/a><\/pre>\n<pre> and for a Sun SDK 1.4.2_12 you should use:<\/pre>\n<pre> <a href=\"ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/java-1.4.2-sun-compat-1.4.2.12-1jpp.i586.rpm\" class=\"external free\" title=\"ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/java-1.4.2-sun-compat-1.4.2.12-1jpp.i586.rpm\" rel=\"nofollow\">ftp:\/\/jpackage.hmdc.harvard.edu\/JPackage\/1.7\/generic\/RPMS.non-free\/java-1.4.2-sun-compat-1.4.2.12-1jpp.i586.rpm<\/a><\/pre>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>rpm -ivh java-1.5.0-sun-compat-1.5.0.12-1jpp.i586.rpm <\/strong><\/td>\n<\/tr>\n<\/table>\n<p>This will create a bunch of links in the \/etc\/alternatives and \/usr\/lib\/jvm directories and others to the \/usr\/java\/jdk1.5.0_07 directory where the Sun JDK distribution resides. To check which files were affected do:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>rpm -q -l java-1.5.0-sun-compat<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>Check if the Sun JDK is really a default by doing:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>java -version<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>If you get:<\/p>\n<p><em>java version &#8220;1.4.2&#8221;<br \/>\ngij (GNU libgcj) version 4.1.1 20060525 (Red Hat 4.1.1-1)<\/em><\/p>\n<p><em>Copyright (C) 2006 Free Software Foundation, Inc.<br \/>\nThis is free software; see the source for copying conditions. There is NO<br \/>\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A<br \/>\nPARTICULAR PURPOSE.<\/em><\/p>\n<p>(or similar) then something did <strong>NOT<\/strong> work. If you get:<\/p>\n<p><em>java version &#8220;1.5.0_07&#8243;Java(TM) 2 Runtime Environment,<br \/>\nStandard Edition (build 1.5.0_07-b03)<br \/>\nJava HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)<\/em><\/p>\n<p>then the Sun JDK is your default. You can use alternatives to check (or change) the default JDK by:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>alternatives &#8211;config java<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>Please read the man page for alternatives:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>man alternatives<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>It should show something like:<\/p>\n<p><em>There are 2 programs which provide \u00e2\u20ac\u2122java\u00e2\u20ac\u2122.<\/em><\/p>\n<p><em>Selection Command<\/em><br \/>\n<em>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/em><br \/>\n<em>1 \/usr\/lib\/jvm\/jre-1.4.2-gcj\/bin\/java<\/em><br \/>\n<em>*+ 2 \/usr\/lib\/jvm\/jre-1.5.0-sun\/bin\/java<\/em><\/p>\n<p><em><br \/>\nEnter to keep the current selection[+], or type selection number:<\/em><br \/>\nHit [Enter] key if you want Sun JDK to be a default, or enter 1 if you want to<br \/>\nchange back to GNU Java.<\/p>\n<p>Now, there will be times, when you want to get rid of Sun JDK and its entries for alternatives. <strong>DO NOT TOUCH THESE LINKS WITH YOUR BARE HANDS<\/strong>. Use yum to uninstall the JPackage Java compatibility package first and then erase the Sun JDK with rpm:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>yum erase java-1.5.0-sun-compat<br \/>\nrpm -e jdk-1.5.0_07-fcs<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>Sometimes yum breaks. A popular situation is when you used rpm to install some package (or the package was installed with an <em>install<\/em> (older package is kept) rather than an <em>update<\/em> (older package is removed). In this case, yum gets confused with dependencies and complains, and it does not want to install a package. To see if this is a case (as it was when installing all of this), list all the installed rpm packages for some package name with a command:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td>bgcolor = &#8220;#CCCCCC&#8221; <strong>rpm -qa | grep &#8220;java&#8221;<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>for example. If you see two versions of the same rpm, just erase the old one. Use the<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>rpm -e full_package_name_with_version<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>(but skip the .rpm) and then try yum update or yum install again. I am telling you this, since we will definitely have more <em>javas<\/em> and <em>compats<\/em> coming, and the mess happens. For example (at this time a hypothetical one), if you got stuck with two <em>compat<\/em> packages when updates to the JDK were processed:<\/p>\n<p><strong>rpm -qa | grep &#8220;java-1.5.0-sun-compat&#8221;<\/strong><sub><\/sub><\/p>\n<p><em>java-1.5.0-sun-compat-1.5.0.07-1jppjava-1.5.0-sun-compat-1.5.0.08-1jpp<\/em><\/p>\n<p>remove the older package as:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>yum erase java-1.5.0-sun-compat-1.5.0.07-1jpp<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>or, if still <em>no go<\/em>:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>rpm -e java-1.5.0-sun-compat-1.5.0.07-1jpp<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>and try again.<\/p>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h2>Set Enviroment varibles<\/h2>\n<p>So&#8230; JAVA_HOME.  In your shell, type:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>JAVA_HOME=\/usr\/lib\/jvm\/java<br \/>\nexport JAVA_HOME<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>or if you are C-shellish:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>setenv JAVA_HOME \/usr\/lib\/jvm\/java<\/strong><\/td>\n<\/tr>\n<\/table>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h2>BIG WORK AROUND FOR USING YUM TO INSTALL<\/h2>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>yum install xml-commons <\/strong><\/td>\n<\/tr>\n<\/table>\n<p>download  the xml-commons-apis rpm from jpackage.org Install by hand using<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>rpm -ivh xml-commons-apis rpm <\/strong><\/td>\n<\/tr>\n<\/table>\n<p>For some reason yum was bugging out and not recognizing the xml-commons-apis.<\/p>\n<p>(I guess this may be a case of screwy obsoletes and provides with some of the jpp packages)<\/p>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h2>Install tomcat5 and apache<\/h2>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>yum install tomcat5 tomcat5-webapps tomcat5-admin-webapps<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>We will use redhats standard apache2 with mod_jk to talk to Tomcat, so first we install:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>yum install httpd mod_jk-ap20<\/strong><\/td>\n<\/tr>\n<\/table>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h2>Testing the install<\/h2>\n<p>Check to make sure the default tomcat users are located in <em>\/etc\/tomcat5\/tomcat-users.xml<\/em>.<\/p>\n<p>[root@centos tomcat5]# cat \/etc\/tomcat5\/tomcat-users.xml<br \/>\n&lt;?xml version=\u00e2\u20ac\u21221.0\u00e2\u20ac\u2122 encoding=\u00e2\u20ac\u2122utf-8\u00e2\u20ac\u2122?&gt;<br \/>\n&lt;tomcat-users&gt;<br \/>\n&lt;role rolename=&#8221;tomcat&#8221;\/&gt;<br \/>\n&lt;role rolename=&#8221;role1&#8243;\/&gt;<br \/>\n&lt;user username=&#8221;tomcat&#8221; password=&#8221;tomcat&#8221; roles=&#8221;tomcat&#8221;\/&gt;<br \/>\n&lt;user username=&#8221;role1&#8243; password=&#8221;tomcat&#8221; roles=&#8221;role1&#8243;\/&gt;<br \/>\n&lt;user username=&#8221;both&#8221; password=&#8221;tomcat&#8221; roles=&#8221;tomcat,role1&#8243;\/&gt;<br \/>\n&lt;\/tomcat-users&gt;<br \/>\n[root@centos tomcat5]#<br \/>\nTest tomcat5:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>\/etc\/rc.d\/init.d\/tomcat5 start<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>If all is well, you can see the tomcat welcome page on 8080.<\/p>\n<p>Test apache:<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>\/etc\/rc.d\/init.d\/httpd start<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>If all is well, you can see the apache welcome page on 80.<\/p>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h2>configure apache to work with mod_jk<\/h2>\n<p>Now we will configure apache to work with mod_jk to grab everything on port 80.<\/p>\n<p>make enviromet veribles persitant<\/p>\n<p>edit \/etc\/profile<\/p>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td bgcolor=\"#cccccc\"><strong>cd \/etc<\/strong><strong>vi profile<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>add lines<\/p>\n<pre>#Tomcat set up add by Joe 27 07 07\r\n\r\nJAVA_HOME=\/usr\/lib\/jvm\/java\r\n\r\nexport JAVA_HOME\r\n\r\nCATALINA_HOME=\/usr\/share\/tomcat5\r\n\r\nexport CATALINA_HOME<\/pre>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h3>Edit tomcat configureation<\/h3>\n<p>Edit the workers.properties file in \/usr\/share\/tomcat5\/conf\/workers.properties<\/p>\n<p>Update the entries for workers.tomcat_home and workers.java_home<\/p>\n<pre>workers.tomcat_home=\/usr\/share\/tomcat5\r\n\r\nworkers.java_home=\/usr\/lib\/jvm\/java<\/pre>\n<p>Change the worker.list from ajp12, ajp13 to just ajp13, or ajp13, inprocess if you want JNI connector. While running the JVM inside the web server gives the best performance, it lacks the stability of the out of process mode.<\/p>\n<pre>workers.list=ajp13<\/pre>\n<p>Comment out the worker.ajp12 entries if you want, it is not necessary.<\/p>\n<p>Change worker.ajp13.host from localhost to your fully qualified domain name or IP address<\/p>\n<pre> worker.ajp13.host=[fully qualified domain name]<\/pre>\n<p>If you want to cache your connections, uncomment worker.ajp13.cachesize and add a value.<\/p>\n<pre>worker.ajp13.cachesize=20<\/pre>\n<p>Change worker.loadbalancer.balanced_workers from ajp12, ajp13 to just ajp13.<\/p>\n<pre>worker.loadbalancer.balanced_workers=ajp13<\/pre>\n<p>If all you need is a simple, straight-forward out of process configuration without load balancing, you can use this as your complete workers.properties file. Again remember to set the host with your fully qualified domain name or IP address<\/p>\n<pre>worker.list=ajp13\r\n\r\nworker.ajp13.type=ajp13\r\n\r\nworker.ajp13.host=[fully qualified domain name]\r\n\r\nworker.ajp13.port=8009<\/pre>\n<p>Edit the Tomcat server.xml file located in $CATALINA_HOME\/conf\/<\/p>\n<p>it should be \/usr\/share\/tomcat5\/conf\/server.xml<\/p>\n<p>Immediately below the entry &lt;Server port=&#8221;8005&#8243; shutdown=&#8221;SHUTDOWN&#8221;&gt; add:<\/p>\n<pre>&lt;Listener className=\"org.apache.jk.config.ApacheConfig\" modJk=\"\/usr\/lib\/httpd\/modules\/mod_jk.so\" workersConfig=\"\/usr\/share\/tomcat5\/conf\/workers.properties\" jkLog=\"\/var\/log\/tomcat5\/logs\/mod_jk.log\" jkDebug=\"info\" \/&gt;<\/pre>\n<p>Find the entry &lt;Host name=&#8221;localhost&#8221; appBase=&#8221;webapps&#8221; unpackWARs=&#8221;true&#8221; autoDeploy=&#8221;true&#8221; xmlValidation=&#8221;false&#8221; xmlNamespaceAware=&#8221;false&#8221;&gt; and change localhost to your fully qualified domain name or IP address.<\/p>\n<pre>&lt;Host name=\"[fully qualified domain name]\" appBase=\"webapps\" unpackWARs=\"true\" autoDeploy=\"true\" xmlValidation=\"false\" xmlNamespaceAware=\"false\"&gt;<\/pre>\n<p>Immidiately following that line add:<\/p>\n<pre>&lt;Listener className=\"org.apache.jk.config.ApacheConfig\" append=\"true\" jkWorker=\"ajp13\" \/&gt;<\/pre>\n<p>Restart Tomcat and verify that the dirctory auto is created and the files mod_jk.conf is created in \/usr\/share\/tomcat5\/conf\/<\/p>\n<p>By configuring Tomcat to create and recreate the mod_jk.conf on startup, it will automatically add a JkMount for any new webapps you deploy.<\/p>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h3>Edit apache configuration<\/h3>\n<p>Edit \/etc\/httpd\/conf\/httpd.conf and after the last LoadModule entry add an Include for the mod_jk.conf:<\/p>\n<pre>Include \"\/usr\/share\/tomcat5\/conf\/auto\/mod_jk.conf\"<\/pre>\n<p>Restart Apache<\/p>\n<p>Browse to <a href=\"http:\/\/localhost\/jsp-examples\/\" class=\"external free\" title=\"http:\/\/localhost\/jsp-examples\/\" rel=\"nofollow\">http:\/\/localhost\/jsp-examples\/<\/a> or any other webapp you have installed in Tomcat and Apache should send it to Tomcat.<\/p>\n<p class=\"editsection\" style=\"float: right; margin-left: 5px\">&nbsp;<\/p>\n<h2>Make tomcat and apache start at bootup<\/h2>\n<p><strong>chkconfig &#8211;level 234 httpd on<\/strong><\/p>\n<p><strong>chkconfig &#8211;level 234 tomcat5 on<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Howto install tomcat 5 on CentOS 4 This has been taken from serral online instruction and combinded with pritical IT Works \ud83d\ude42 This howto is assuming that you have a working, minimal installation of CentOS. I will repeat that because if not properly understood it will cause you lots of headaches later. A MINIMAL installation [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[7,3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4T97-26","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":129,"url":"https:\/\/www.purple-penguin.org\/blog\/2007\/07\/11\/our-first-vip\/","url_meta":{"origin":130,"position":0},"title":"Our First V.I.P.","date":"Wednesday, 11 July 2007","format":false,"excerpt":"Yes folks after many months of hard work at the Hippy Factory (other wise known as the place where i work). We have are fist V.I.P thats Virtual In-house Penguin. Since the start of the year we (in an office IT team) have been trailing and experimenting with visualization using\u2026","rel":"","context":"In &quot;Dyslexic Discourse&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":142,"url":"https:\/\/www.purple-penguin.org\/blog\/2008\/02\/15\/new-toy-olpc-xo\/","url_meta":{"origin":130,"position":1},"title":"New Toy (OLPC XO)","date":"Friday, 15 February 2008","format":false,"excerpt":"So played with the green machine witch looks like it will be called George as its two cute, note i resisted the erge to go tooooooo, but it is. Had some trouble inishaly\u00c2\u00a0 getting it on to a wpa2 net work looks like it ones the pass key in hex\u2026","rel":"","context":"In &quot;Dyslexic Discourse&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":132,"url":"https:\/\/www.purple-penguin.org\/blog\/2007\/08\/23\/so-lime-wire-writen-in-norfolk\/","url_meta":{"origin":130,"position":2},"title":"So Lime wire writen in Norfolk ?","date":"Thursday, 23 August 2007","format":false,"excerpt":"Just upgraded my limewire pro installation witch is a pice of software i have used for meny years. How ever some distebing things on the horizan thay now no longer ship a linux rpm only debts ?. So i had to down load the other linux witch is basical a\u2026","rel":"","context":"In &quot;Dyslexic Discourse&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":44,"url":"https:\/\/www.purple-penguin.org\/blog\/2005\/11\/27\/last-post-before-we-leave\/","url_meta":{"origin":130,"position":3},"title":"Last post before we leave","date":"Sunday, 27 November 2005","format":false,"excerpt":"We are packed and ready - off tomorrow evening. Joe still claims not to know where we are going so hopefully still a surprise. Of course he's pacing about driving me crazy. So it goes. We managed to fit everything into our bags. With minimal sitting on the bag to\u2026","rel":"","context":"In &quot;Travel&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":161,"url":"https:\/\/www.purple-penguin.org\/blog\/2008\/06\/22\/onwards\/","url_meta":{"origin":130,"position":4},"title":"Onwards","date":"Sunday, 22 June 2008","format":false,"excerpt":"Last day in Jamaica and we're off to Trinidad. Being collected at 10.30 and the flight is at 2pm. We're flying off with many of the Caribbean delegates who were at the conference as we're stopping on another couple of islands along the way to Trinidad. So I get to\u2026","rel":"","context":"In &quot;Travel&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":420,"url":"https:\/\/www.purple-penguin.org\/blog\/2010\/09\/01\/more-meetings-in-ghana\/","url_meta":{"origin":130,"position":5},"title":"More meetings in Ghana","date":"Wednesday, 1 September 2010","format":false,"excerpt":"The conference happened and everything seemed to go well, even if it did run late. We had some excursions - one to Cape Coast Castle which was a little depressing but very interesting. We got a guided tour of the castle (more of a fort than a castle) with the\u2026","rel":"","context":"In &quot;Frog Blog&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/posts\/130"}],"collection":[{"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/comments?post=130"}],"version-history":[{"count":0,"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/posts\/130\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/media?parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/categories?post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.purple-penguin.org\/blog\/wp-json\/wp\/v2\/tags?post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}