1.安裝PHP+mysql+Apache2...注意,Apache要帶上--enable-so2.安裝JDK環境到Java網站下載:j2sdk-1_4_2_07-Linux-i586.bin#chmod a+x j2sdk-1_4_2_07-linux-i586.bin#./j2sdk-1_4_2_07-linux-i586.bin#mv j2sdk-1_4_2_07 /usr/local/jdk#vi /etc/profileeXPort JAVA_HOME=/usr/local/jdkexport PATH=$PATH:$JAVA_HOME/binexport CLASSPATH=$JAVA_HOME/lib如果是RHEL3的話,還需要刪除原來的空Java環境#rm -f /usr/bin/java#rm -f /usr/bin/javac#rm -f /etc/alternatives/java#rm -f /etc/alternatives/javac重新登錄#java -version查看是否正確.3.安裝Tomcat到Apache的網站上下載:jakarta-tomcat-5.0.30.tar.gz#tar xzvf jakarta-tomcat-5.0.30.tar.gz#mv jakarta-tomcat-5.0.30 /usr/local/tomcat運行/usr/local/tomcat/bin/startup.sh啟動Tomcat,http://IP:8080/查看是否安裝成功.4.安裝mod_jk2下載:jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz#tar zxvf jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz#cd jakarta-tomcat-connectors-jk2-2.0.4-src/#cd jk/native2#./configure --with-apxs2=/usr/local/apache2/bin/apxs #make#cp ../build/jk2/apache2/mod_jk2.so /usr/local/apache2/modules(如果不成功,有提示錯誤的話,請安裝liBTool的高版本:http://www.gnu.org/software/libtool/tar zxvf libtool-1.5.14.tar.gzcd libtool-1.5.14./configuremakemake install)5.配置a.httpd.conf(/usr/local/apache2/conf/)不讓/WEB-INF下的文檔暴露Order allow,denyDeny from all加載jk2模塊LoadModule jk2_module modules/mod_jk2.sob.workers2.properties(/usr/local/apache2/conf/此文件為新建)[logger.apache2]level=info #日志級別[shm]file=/var/logs/httpd/shm.logsize=1048576 #這個不知道干什麼的??[channel.socket:localhost:8009]port=8009 #apache和tomcat的通訊端口host=127.0.0.1[ajp13:localhost:8009]channel=channel.socket:localhost:8009[uri:/*.jsp] worker=ajp13:localhost:8009[uri:/servlet/*]worker=ajp13:localhost:8009c./usr/local/tomcat/conf/server.XML在前面加上:6.啟動測試啟動Tomcat和Apache測試.7.啟動腳本可以在/etc/init.d/下面,按照httpd格式建一個啟動腳本,用/usr/local/tomcat/bin/startup.sh啟動/usr/local/tomcat/bin/shutdown.sh停止注意,腳本前要加上/etc/profile裡的環境變量.chkconfig --add tomcatchkconfig tomcat on8.參考:http://ms.mblogger.cn/andijo/posts/8534.ASPxhttp://chinaunix.net/jh/13/306170.Htmlhttp://blogger.org.cn/blog/more.asp?name=sixsun&id=1027http://www.jmyes.com/viewthread.php?tid=9952&extra=page%3D1