How to install Tomcat on CentOS

How to Install Tomcat 8 on CentOS 7.0 (Multiple Instances)

https://www.howtoforge.com/how-to-install-tomcat-on-centos-7

Install Oracle Java JDK 8 On CentOS 7

yum install java-1.8.0-openjdk.x86_64

# java -version

# cd /usr/share
# wget http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.9/bin/apache-tomcat-8.0.9.tar.gz
# tar zxvf apache-tomcat-8.0.9.tar.gz

# groupadd tomcat
# useradd -g tomcat -s /bin/bash -d /usr/share/apache-tomcat-8.0.9 tomcat
# chown -Rf tomcat.tomcat /usr/share/apache-tomcat-8.0.9/

# su – tomcat

$ cd bin
$ ./startup.sh

start the service: sh startup.sh or ./startup.sh

stop the service sh :shutdown.sh or ./shutdown.sh

netstat -an | grep 8080

ps -ef  | grep tomcat

kill

tomcat修改默认端口:

<connector port=”80“protocol=”HTTP/1.1″connectionTimeout=”20000”      redirectPort=”8443″/>

tomcat设置IP地址或者域名访问

<Host name=”www.mydomain.com”  appBase=”webapps”     unpackWARs=”true”/>

SSL免费证书申请:

腾讯云 SSL证书管理

tomcat 配置SSl:

conf/server.xml中

<Connector
protocol=”org.apache.coyote.http11.Http11NioProtocol”
port=”443″ maxThreads=”200″
scheme=”https” secure=”true” SSLEnabled=”true”
keystoreFile=”conf/xxx.jks” keystorePass=”password”
clientAuth=”false” sslProtocol=”TLS”/>