以centos6.8安装tomcat7为例
1.获取apache-tomcat-7.0.73.tar.gz文件
2.解压
sudo tar -zxvf apache-tomcat-7.0.73.tar.gz
3.编辑server.xml将字符集配置成UTF-8
cd apache-tomcat-7.0.73/
sudo vim conf/server.xml
找到此节点,新增斜体部分<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8" >
4.配置环境变量
export CATALINA_HOME=/developer/apache-tomcat-7.0.73
在PATH环境变量后面增加$CATALINA_HOME/bin
5.测试启动
cd /developer/apache-tomcat-7.0.73/bin
sudo ./startup.sh
出现一下文字则安装成功
Using CATALINA_BASE: /developer/apache-tomcat-7.0.73
Using CATALINA_HOME: /developer/apache-tomcat-7.0.73
Using CATALINA_TMPDIR: /developer/apache-tomcat-7.0.73/temp
Using JRE_HOME: /usr
Using CLASSPATH: /developer/apache-tomcat-7.0.73/bin/bootstrap.jar:/developer/apache-tomcat-7.0.73/bin/tomcat-juli.jar
Tomcat started.