1.在/etc/profile中
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export JAVA_HOME=/usr/java/jdk1.7.0_71
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH
export TOMCAT_HOME=/usr/java/apache-tomcat-7.0.57
export CATALINA_HOME=/usr/java/apache-tomcat-7.0.57
export CATALINA_BASE=/usr/java/apache-tomcat-7.0.57
export TOMCAT_HOME_2=/usr/java/nginx-apache-tomcat-7
export CATALINA_HOME_2=/usr/java/nginx-apache-tomcat-7
export CATALINA_BASE_2=/usr/java/nginx-apache-tomcat-7
2.在nginx-apache-tomcat-7中
配置 export CATALINA_HOME=$CATALINA_HOME_2
export CATALINA_BASE=$CATALINA_BASE_2
3.修改nginx-apache-tomcat-7中的server.xml
<Server port="9005" shutdown="SHUTDOWN"> (8005->9005)
<Connector port="9088" protocol="HTTP/1.1" (8080->9088)
<Connector port="9009" protocol="AJP/1.3" redirectPort="8443" />(8009->9009)
原文地址:http://yaomy.blog.51cto.com/8892139/1614663