安裝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 工具(二進(jìn)制程序)
/usr/local/tomcat/conf 配置文件? ? server.xml
/usr/local/tomcat/logs
/usr/local/tomcat/webapps 默認(rèn)的應(yīng)用程序目錄
啟動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
===============================================================================================================