chmod +x jdk-6u7-linux-i586-rpm.bin ./jdk-6u7-linux-i586-rpm.bin vi /etc/profile export JAVA_HOME=/usr/java/default export PATH=$PATH:$JAVA_HOME/bin export TOMCAT_HOME=/usr/local/tomcat export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar:$TOMCAT_HOME/lib/ser vlet-api.jar source /etc/profile -- TEST vi HelloWorld.java public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } } javac HelloWorld.java java HelloWorld@ -- wget http://www.uniontransit.com/apache/tomcat/tomcat-6/v6.0.18/bin/apache- tomcat-6.0.18.tar.gz tar zxvf apache-tomcat-6.0.14.tar.gz mv apache-tomcat-6.0.14/ /usr/local/tomcat vi /etc/profile.d/tomcat.sh export JAVA_HOME=/usr/java/default export PATH=$PATH:$JAVA_HOME/bin export TOMCAT_HOME=/usr/local/tomcat export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar:$TOMCAT_HOME/lib/servlet-api.jar export CATALINA_HOME=/usr/local/tomcat export CLASSPATH=$CLASSPATH:$CATALINA_HOME/lib/servlet-api.jar vi /etc/rc.d/init.d/tomcat #!/bin/bash # # Startup script for the tomcat # # chkconfig: 345 80 15 # description: Tomcat is a Servlet+JSP Engine. # Source function library. . /etc/rc.d/init.d/functions source /etc/profile.d/tomcat.sh start(){ if [ -z $(/sbin/pidof java) ]; then echo "Starting tomcat" /usr/local/tomcat/bin/startup.sh touch /var/lock/subsys/tomcat else echo "tomcat allready running" fi } stop(){ if [ ! -z $(/sbin/pidof java) ]; then echo "Shutting down tomcat" /usr/local/tomcat/bin/shutdown.sh until [ -z $(/sbin/pidof java) ]; do :; done rm -f /var/lock/subsys/tomcat else echo "tomcat not running" fi } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) /usr/local/tomcat/bin/catalina.sh version ;; *) echo "Usage: $0 {start|stop|restart|status}" esac exit 0 chmod +x /etc/rc.d/init.d/tomcat /etc/rc.d/init.d/tomcat start vi /etc/httpd/conf.d/proxy_ajp.conf ProxyPass /tomcat/ ajp://localhost:8009/ ProxyPass /examples/ ajp://localhost:8009/examples/ /etc/rc.d/init.d/httpd reload