CENTOS 7.X使用YUM安装LNMP运行环境

一、NGINX
准备
yum install epel-release
安装
yum install nginx
启动
systemctl start nginx
systemctl enable nginx

防火墙设置
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

二、MARIADB
安装
yum install mariadb mariadb-server
启动
systemctl start mariadb
systemctl enable mariadb

安全设置
mysql_secure_installation

三、MYSQL8(坑多,不建议安装)

准备
rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
安装
yum install mysql-community-server
密码
grep 'temporary password' /var/log/mysqld.log
启动
systemctl start mysqld
systemctl enable mysqld

四、PHP7.2
准备
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
yum install yum-utils
yum-config-manager --enable remi-php72

安装
yum install php-fpm php-common
yum install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pecl-redis php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-tidy php-xml

启动
systemctl start php-fpm
systemctl enable php-fpm