1.1 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/
1.2 配置环境变量
vim /etc/profile
1.3 在文件最后面添加如下三行内容(具体路径根据自己的实际情况确定)
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin
1.4 使配置文件即时生效
source /etc/profile
1.5 检查jdk是否安装按成
java -version二.MySQL
2.1 mysql
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm yum repolist enabled | grep "mysql.*" yum -y install mysql-community-server2.2 常用 *** 作命令
systemctl enable mysqld systemctl start mysqld systemctl status mysqld.service三.iptables
3.1 iptables
3.2 停止
firewalld systemctl stop firewalld3.4 屏蔽
firewalld systemctl mask firewalld yum install iptables-services
3.3 启用
iptables systemctl enable iptables systemctl start iptables service iptables save
3.5 配置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 ACCEPT3.6 重启iptables
systemctl restart iptables四.Nginx
4.1 nginx
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm yum info nginx yum install nginx五.Redis
4.2 redis
yum install epel-release && yum install redis cp /etc/redis.conf /etc/redis.conf.back4.3 配置redis密码(强烈建议)
vim /etc/redis.conf4.4 在配置文件中找到requirepass,将前面的#号注释放开,后面填上自己的redis密码,保存文件,重启redis即可
requirepass password service redis start
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)