lnmp环境搭建
一、环境准备 1、关闭防火墙及配置yum源 为了方便,我这里直接使用脚本一键环境配置(仅限于redhat系列6和7)。 [root@centos7 ~]# cat cofig.sh #!/bin/bash str=`cat /etc/redhat-release |awk '{print $4}'|awk -F '.' '{print $1}'` version=0 mkdir /etc/yum.repos.d/bak &>/dev/null mv /etc/yum.repos.d/* /etc/yum.repos.d/bak/ &>/dev/null if [ $str == 7 ];then version=7 else version=6 fi echo $version if [ $version -eq 7 ];then #关闭防火墙及开机自启 systemctl stop firewalld systemctl disable firewalld #关闭selinux setenforce 0 sed -i 7s/enforcing/disabled/g /etc/selinux/config wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo