Centos7下jdk、mysql、iptables、nginx、redis安装简介

[复制链接]
ordersy 发表于 2019-1-6 09:34:42 | 显示全部楼层 |阅读模式
一.JDK
# jdk
yum search java | grep -i --color JDK
yum install java-1.8.0-openjdk  java-1.8.0-openjdk-devel
cd /usr/lib/jvm/
cd java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/
# 配置环境变量
vim /etc/profile
# 在文件最后面添加如下三行内容(具体路径根据自己的实际情况确定)
  1. export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport PATH=$PATH:$JAVA_HOME/bin
复制代码

# 使配置文件即时生效source /etc/profile
# 检查jdk是否安装按成java -version
二.MySQL
# mysqlrpm -Uvh http://dev.mysql.com/get/mysql-c ... el7-5.noarch.rpmyum repolist enabled | grep "mysql.*"yum -y install mysql-community-server
# 常用操作命令systemctl enable mysqldsystemctl start mysqldsystemctl status mysqld.service
三.iptables
# iptables
# 停止firewalldsystemctl stop firewalld# 屏蔽firewalldsystemctl mask firewalld
yum install iptables-services
# 启用iptablessystemctl enable iptables
systemctl start iptablesservice iptables save
# 配置iptables规则vim /etc/sysconfig/iptables    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT    -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT# 重启iptablessystemctl restart iptables
四.Nginx
# nginxrpm -ivh http://nginx.org/packages/centos ... 7.ngx.noarch.rpmyum info nginxyum install nginx
五.Redis
# redisyum install epel-release && yum install rediscp /etc/redis.conf /etc/redis.conf.back
# 配置redis密码(强烈建议)vim  /etc/redis.conf
# 在配置文件中找到requirepass,将前面的#号注释放开,后面填上自己的redis密码,保存文件,重启redis即可requirepass passwordservice redis start

啦啦啦
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则