安装

  1. wget http://tianyunperfect.oss-cn-hongkong.aliyuncs.com/file/tomcat/tomcat9/apache-tomcat-9.0.16.tar.gz
  2. sudo tar -zxvf apache-tomcat-9.0.16.tar.gz -C /usr/local/
  3. rm ./apache-tomcat-9.0.16.tar.gz
  4. sudo /usr/local/apache-tomcat-9.0.16/bin/startup.sh
  5. # 开机启动
  6. sudo vim /etc/rc.d/init.d/autostart
  7. # tomcat
  8. export JAVA_HOME=/usr/local/jdk1.8.0_191
  9. /usr/local/apache-tomcat-9.0.16/bin/startup.sh

get乱码

  1. vim /usr/local/apache-tomcat-7.0.91/conf/server.xml
  2. <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/>