Tomcat部署
安装Tomcat
=========================================================================================
1、安装JDK
[root@tomcat ~]# rpm -ivh jdk-8u121-linux-x64.rpm
[root@tomcat jdk1.8.0_121]# tail -2 /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_121
export PATH=$PATH:$JAVA_HOME/bin
[root@tomcat jdk1.8.0_121]# source /etc/profile
[root@tomcat jdk1.8.0_121]# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
[root@tomcat jdk1.8.0_121]#
2、安装tomcat
[root@tomcat ~]# tar zxf apache-tomcat-8.5.12.tar.gz -C /usr/local/
[root@tomcat ~]# ls /usr/local/
apache-tomcat-8.5.12 bin etc games include lib lib64 libexec sbin share src
[root@tomcat ~]#
[root@tomcat ~]# ln -s /usr/local/apache-tomcat-8.5.12 /usr/local/tomcat
[root@tomcat ~]# vim /etc/profile
export CATALINA_HOME=/usr/local/tomcat
[root@tomcat ~]# source /etc/profile
tomcat目录介绍
/usr/local/tomcat/bin 工具(二进制程序)
/usr/local/tomcat/conf 配置文件 server.xml
/usr/local/tomcat/logs
/usr/local/tomcat/webapps 默认的应用程序目录
启动tomcat
[root@tomcat ~]# /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.8.0_121
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@tomcat ~]# ss -antp | grep java
LISTEN 0 100 :::8009 :::* users:(("java",pid=2627,fd=47))
LISTEN 0 100 :::8080 :::* users:(("java",pid=2627,fd=46))
http://192.168.122.101:8080/
================增加熵池大小,解决Tomcat在CentOS 7巨慢的问题=================================================
[root@tomcat ~]# cp /usr/lib/systemd/system/rngd.service /etc/systemd/system
[root@tomcat ~]# vim /etc/systemd/system/rngd.service
[Service]
ExecStart=/sbin/rngd -f -r /dev/urandom
[root@tomcat ~]# systemctl daemon-reload
[root@tomcat ~]# systemctl restart rngd
[root@tomcat ~]# cat /proc/sys/kernel/random/entropy_avail
2979
===============================================================================================================