1.安装nginx
vim /etc/yum.repos.d/nginx.repo
# OS替换为centos
# OSRELEASE 替换为7
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
yum install nginx
2.安装php
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#安装
yum install php71w php71w-cli php71w-fpm php71w-gd php71w-ldap php71w-mcrypt php71w-mysqlnd php71w-pdo php71w-pear php71w-pear.noarch php71w-soap php71w-xml
3.安装mysql5.7
vim /etc/yum.repos.d/mysql-community.repo
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
yum install mysql-community-server
# 安装完成
service mysqld start
# 查找默认密码
grep "password" /var/log/mysqld.log
# 登录数据库并修改默认密码
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
# 更新授权
flush privileges