1.nginx 安装
安装:
$ yum install -y nginx
如果出现CentOS No package nginx available.
解决办法:
先安装epel: $ yum install epel-release
然后再安装nginx
Centos6.8将/etc/nginx/conf.d/default.conf里的listen [::]:80 default_server;前面加#
Centos7 将/etc/nginx/nginx.conf里的listen [::]:80 default_server;前面加#
Centos6.8安装完成之后可以通过 service nginx start 来启动服务
Centos7 用systemctl start nginx 启动服务
注:
/etc/init.d/nginx start # 启动Nginx服务
/etc/init.d/nginx stop # 停止Nginx服务
/etc/nginx/nginx.conf # Nginx配置文件位置
nginx的安装到此完成,启动之后可以在浏览器ip访问,会显示nginx的页面
2.安装php, php-fpm
aliyun镜像的php版本太低,需要对yum源进行更新
不要搞错系统版本
CentOS/RHEL 7.x:(Centos 7.0以上的版本)
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
CentOS/RHEL 6.x:(Centos6.0~Centos 7.0的版本)
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
原文:https://www.cnblogs.com/ksy-c/p/12718001.html