在安装tomcat之前,需要安装jdk环境:
 chmod o+x jdk-6u17-linux-x64.bin
 ./jdk-6u17-linux-x64.bin
 按空格键完成协议,当出现提示"Do you agree to the above license terms?[yes or no]"时,输入“yes”。完成安装
 mv jdk1.6.0_20/ /usr/local/java
 ln -s /usr/local/java/jre/ /usr/local/jre
 mv /usr/bin/java  /usr/bin/java.bak
 ln -s /usr/local/java/bin/java /usr/bin/java
 ln -s /usr/local/java/bin/javac /usr/bin/javac
 
/etc/profile   ### 加入以下内容然后source
 
 JAVA_HOME=/usr/local/java
 JRE_HOME=/usr/local/jre
 CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
 PATH=$PATH:/usr/local/java/bin:/usr/local/jre/bin
 export JAVA_HOME JRE_HOME CLASSPATH PATH
 source /etc/profile

tar zxvf apache-tomcat-6.0.20.tar.gz
mv apache-tomcat-6.0.20 /usr/local/tomcat
cp -rf /usr/local/tomcat/webapps/* /www
vi /usr/local/tomcat/conf/server.xml
将appBase="webapps",修改为appBase="/www"