tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gurumoorthy" <g.raghupa...@btinternet.com>
Subject Re: mod_jk works as localhost only
Date Fri, 17 Jun 2005 18:36:46 GMT
<Host name="localhost"
appBase="webapps" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" >
		<Alias>localhost</Alias>
		<Alias>www</Alias>
		<Alias>10.0.0.10</Alias>

First of all please read the documents of how to install things ...
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/vhosthowto.html

----- Original Message -----
From: "naidim" <naidim@gmail.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Friday, June 17, 2005 4:59 PM
Subject: Re: mod_jk works as localhost only


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 flex.homelinux.org and it works as
flex.homelinux.org, 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 flex.homelinux.org:80
       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
       Add:
               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
http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi
       #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
       Add:
               CATALINA_HOME=/usr/java/jakarta-tomcat-5.5.9
               export CATALINA_HOME
       #/usr/java/jakarta-tomcat-5.5.9/bin/startup.sh
       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/catalina.sh
/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
               CATALINA_HOME=/usr/java/jakarta-tomcat-5.5.9
               JAVA_HOME=/usr/java/jdk1.5.0_03

               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
               else
                   echo "Tomcat is stopped"
               fi
               }
       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
                       status

               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
http://www.jpackage.org/rpm.php?id=2456
       # rpm -ivh mod_jk-ap20-1.2.10-1jpp.i386.rpm

Configure worker.properties for Apache/Tomcat connection
       Edit /usr/java/jakarta-tomcat-5.5.9/conf/worker.properties
       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"
modJk="/usr/lib/httpd/modules/mod_jk.so"
workersConfig="/usr/java/jakarta-tomcat-5.5.9/conf/workers.properties"
jkLog="/usr/java/jakarta-tomcat-5.5.9/logs/mod_jk.log"
jkDebug="info"/>
       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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message