tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From naidim <>
Subject Re: mod_jk works as localhost only
Date Fri, 17 Jun 2005 15:59:26 GMT
Guru suggested it was my server.xml.  I had <Host name="localhost"
appBase="webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

So I changed Host from localhost to and it works as, but not as localhost now, and still not by IP.

After a default install of FC3 with httpd, here are the changes I made:

Configure Apache
       13 Jun 05
       Edit /etc/httpd/conf/httpd.conf
       Change ServerAdmin to [email]
       Uncomment #ServerName and change host to
       Verify ServerRoot "/etc/httpd"
       Verify DocumentRoot "/var/www/html"
       Change UseCanonicalName from Off to On
       Restart httpd service

Configure Apache for CGI
       13 Jun 05
       Edit /etc/httpd/conf/httpd.conf
       Change "Options Indexes FollowSymLings" to "Options Indexes Includes
FollowSymLinks SymLinksifOwnerMatch ExecCGI Multiviews"
       Change "Allow Override None" to "Allow Override Options Fileinfo
AuthConfig Limit"
       Restart httpd service
       Change "DirectoryIndex index.html index.html.var" to "DirectoryIndex
index.html index.html.var index.shtml index.cgi index.php index.php3
index.phtml index.htm"
       Under AddType application/x-gzip .gz .tgz
               AddType application/x-httpd-php .php .php3 .html .htm
.shtml .phps .fds
       Uncoment AddHandler cgi-script .cgi
       Add .pl to the end of the line
       Restart httpd service

Install Tomcat
       13 Jun 05
       Download jakarta-tomcat-5.5.9.tar.gz and
jakarta-tomcat-5.5.9-admin.tar.gz from
       #tar xvzf jakarta-tomcat-5.5.9.tar.gz
       #tar xvzf jakarta-tomcat-5.5.9-admin.tar.gz
       #mv jakarta-tomcat-5.5.9 /usr/java
       Edit /etc/profile
               export CATALINA_HOME
       Browse to localhost:8080

Open Port 8080 for Tomcat
       13 Jun 05
       Applications->System Settings->Security Level
       Add port 8080:tcp

Autostart Tomcat
       #cp /usr/java/jakarta-tomcat-5.5.9/bin/ /etc/init.d/catalina
       Edit /etc/init.d/catalina
       Add as the last comments at the top
       # chkconfig: - 90 15
       # description: Jakarta Tomcat Java Servlets and JSP server
       Add immediately after the top comments

               status() {
                   ps ax --width=1000 | grep
"[o]rg.apache.catalina.startup.Bootstrap start" | awk '{printf $1 "
"}' | wc | awk '{print $2}' > /tmp/tomcat_process_count.txt
                  read line < /tmp/tomcat_process_count.txt
               if [ $line -gt 0 ]; then
                   echo -n "Tomcat ( pid "
                   ps ax --width=1000 | grep
"[o]rg.apache.catalina.startup.Bootstrap start" | awk '{printf $1 "
                   echo -n ") is running..."
                   echo "Tomcat is stopped"
       Comment out [ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd
"$PROGDIR/.." ; pwd`
       Before echo "Using CATALINA_BASE: $CATALINA_BASE" add
               if [ "$1" != "status" ] ; then
       After the echo block add "fi"
       Add immediately before "else" for if [ "$1" = "debug" ] block
               elif [ "$1" = "status" ] ; then

               elif [ "$1" = "restart" ] ; then
                       $0 stop
                       $0 start

Add catalina as a service and turn it on
       # chkconfig --add catalina
       # chkconfig catalina on

Install mod_jk for Apache/Tomcat connection
       Download mod_jk-ap20-1.2.10-1jpp.i386.rpm from
       # rpm -ivh mod_jk-ap20-1.2.10-1jpp.i386.rpm

Configure for Apache/Tomcat connection
       Edit /usr/java/jakarta-tomcat-5.5.9/conf/
       Change workers.tomcat_home=/var/tomcat3 to /usr/java/jakarta-tomcat-5.5.9
       Change workers.java_home=/opt/IBMJava2-13 to /usr/java/jdk1.5.0_03
       Change worker.list=ajp12, ajp13 to worker.list=ajp13
       Comment out all worker.ajp12 lines
       Uncomment worker.ajp13.cachesize and add =20
       Change worker.loadbalancer.balanced_workers=ajp12, ajp13 to just ajp13

Configure server.xml for Apache/Tomcat connection
       Edit /usr/java/jakarta-tomcat-5.5.9/conf/server.xml
       Below the line <Server port="8005"> add
               <Listener className="org.apache.jk.config.ApacheConfig"
       Below the line <Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true" xmlValidation="false"
xmlNamespaceAware="false"> add
               <Listener className="org.apache.jk.config.ApacheConfig"
append="true" jkWorker="ajp13" />

       Restart Tomcat
       Verify /usr/java/jakarta-tomcat-5.5.9/conf/auto/mod_jk.conf is created

Disable SELinux for httpd
       Applications->System Settings->Securty Level
       Check Disable SELinux protection for httpd daemon

Configure httpd.conf for Apache/Tomcat connection
       Edit /etc/httpd/conf/httpd.conf
       Below the last LoadModule line add
               Include "/usr/java/jakarta-tomcat-5.5.9/conf/auto/mod_jk.conf"
       Restart apache

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message