分类: LINUX
2009-05-27 12:45:17
[root@wardking ~]# tar zxvf apache-tomcat-6.0.14.tar.gz -C /usr/local/
[root@wardking ~]# mv jdk-6u3-linux-i586.bin /usr/local/
[root@wardking ~]# cd /usr/local
[root@wardking ~]# chmod a+x jdk-6u3-linux-i586.bin
[root@wardking ~]# ./jdk-6u3-linux-i586.bin
[root@wardking ~]# ln -sf /usr/local/apache-tomcat-6.0.14 /usr/local/tomcat
[root@wardking ~]# ln -sf /usr/local/jdk1.6.0_03 /usr/local/jdk6
[root@wardking ~]# ln -sf /usr/local/jdk6/bin/java /usr/bin/
[root@wardking ~]# ln -sf /usr/local/tomcat/bin/startup.sh /usr/bin/tomcat-up
[root@wardking ~]# ln -sf /usr/local/tomcat/bin/shutdown.sh /usr/bin/tomcat-down
[root@wardking ~]# vi /usr/local/tomcat/conf/tomcat-users.xml
[root@wardking ~]# vi /etc/profile
JAVA_HOME=/usr/local/jdk6
CATALINA_HOME=/usr/local/tomcat
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/lib/servlet-api.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CATALINA_HOME CLASSPATH PATH
[root@wardking ~]# source /etc/profile
[root@wardking ~]# /usr/bin/tomcat-up
或者直接执行
/usr/local/tomcat/bin/startup.sh
停止tomcat服务
# tomcat-down
# cp mod_jk-1.2.23-apache-2.2.x-linux-i686.so /etc/httpd/modules/
[root@wardking ~]# cat /etc/httpd/conf.d/mod_jk.conf
LoadModule jk_module modules/mod_jk-1.2.23-apache-2.2.x-linux-i686.so
JkWorkersFile "/etc/httpd/conf/workers.properties"
JkShmFile /var/log/httpd/mod_jk.shm
JkLogFile "/var/log/httpd/mod_jk.log"
JkLogLevel info
JkMount /*/servlet/* ajp13
JkMount /*.jsp ajp13
JkMount /*.do ajp13
AddType application/x-jsp .jsp
[root@wardking ~]# vi /etc/httpd/conf/workers.properties
[shm]
file=/etc/httpd/logs/shm.file
size=1048576
[channel.socket:localhost:8009]
tomcatId=localhost:8009
[uri:/jsp-examples/*]
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/local/jdk6
ps=\
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
[root@wardking ~]# vi /usr/local/tomcat/conf/server.xml
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
[root@wardking ~]# httpd -t
[root@wardking ~]# service httpd restart
[root@wardking ~]# /usr/bin/tomcat-up
ProxyPass / ajp://127.0.0.1:8009/
ProxyPassReverse / ajp://127.0.0.1:8009/