DevOps之五 Tomcat的安装与配置
安装说明
安装环境:CentOS-7
安装方式:源码安装
软件:apache-tomcat-9
下载地址:https://tomcat.apache.org/download-90.cgi
一、安装tomcat
cd /usr/local wget http://mirrors.shuosc.org/apache/tomcat/tomcat-9/v9.0.2/bin/apache-tomcat-9.0.2.tar.gz tar -zxv -f apache-tomcat-9.0.2.tar.gz // 解压压缩包 mv apache-tomcat-9.0.2 tomcat
二、添加JDK路径
vi /usr/local/tomcat/apache-tomcat-9.0.2/bin/setclasspath.sh 添加下面内容: export JAVA_HOME=/usr/java/jdk1.8.0_121 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
三、修改端口
tomcat的默认端口是8080,如果被占用如下修改
vi /usr/local/tomcat/apache-tomcat-9.0.2/conf/server.xml <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
四、启动tomcat
# /usr/local/tomcat/bin/startup.s