-
- yum search java|grep jdk
-
- yum install java-1.8.0-openjdk
-
- 安装完之后,默认的安装目录是在: /usr/lib/jvm/java。。。
-
- vi /etc/profile // 设置环境变量
- #set java environment
- JAVA_HOME=/usr/lib/jvm/jdk1.8
- JRE_HOME=$JAVA_HOME/jre
- CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
- PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
- export JAVA_HOME JRE_HOME CLASS_PATH PATH
-
- source /etc/profile 立即生效
-
- java -version 验证是否生效
-
- mv apache-tomcat-8.5.15.tar.gz /usr/local/
-
- tar -zxvf apache-tomcat-8.5.15.tar.gz
-
- mv apache-tomcat-8.5.15 tomcat
-
- 编辑 vi /usr/local/tomcat/bin/catalina.sh
- JAVA_HOME=/usr/lib/jvm/jdk1.8
- JAVA_OPTS="-Ddruid.registerToSysProperty=true"
-
- 将8080端口添加到防火墙例外并重启
- i. systemctl start firewalld.service
- ii. firewall-cmd --zone=public --add-port=8080/tcp --permanent
- iii. firewall-cmd --reload
- iv. #停止firewall systemctl stop firewalld.service
- #禁止firewall开机启动 systemctl disable firewalld.service
- 将8080端口添加到防火墙例外并重启
-
- tomcat 启动巨慢的解决方法
- i. 安装熵服务 yum install rng-tools
- ii. 启动熵服务 systemctl start rngd
- iii. 熵服务状态 systemctl status rngd
- iv. 重新载入服务
- systemctl daemon-reload
- systemctl restart rngd