Skip to content

rachelliqian/Centos-develop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

查看版本

cat /etc/redhat-release

Java 安装

    1. yum search java|grep jdk
    1. yum install java-1.8.0-openjdk
    1. 安装完之后,默认的安装目录是在: /usr/lib/jvm/java。。。
    1. 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
    1. source /etc/profile 立即生效
    1. java -version 验证是否生效

Tomcat 安装

    1. 下载: wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.tar.gz
    1. mv apache-tomcat-8.5.15.tar.gz /usr/local/
    1. tar -zxvf apache-tomcat-8.5.15.tar.gz
    1. mv apache-tomcat-8.5.15 tomcat
    1. 编辑 vi /usr/local/tomcat/bin/catalina.sh
    • JAVA_HOME=/usr/lib/jvm/jdk1.8
    • JAVA_OPTS="-Ddruid.registerToSysProperty=true"
    1. 将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
    1. tomcat 启动巨慢的解决方法
    • i. 安装熵服务 yum install rng-tools
    • ii. 启动熵服务 systemctl start rngd
    • iii. 熵服务状态 systemctl status rngd
    • iv. 重新载入服务
    • systemctl daemon-reload
    • systemctl restart rngd

About

CentOS 开发环境配置

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published