使用yum源直接安装nginx
1、配置nginx源
centos6:
1 |
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm |
centos7:
1 |
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm |
2、安装nginx(默认会安装最新的稳定版)
1 |
yum -y install nginx |
3、默认配置文件
/etc/nginx/nginx.conf
4、设置开机自启及启动nginx
centos6:
1 2 |
chkconfig nginx on service nginx start |
centos7:
1 2 |
systemctl enable nginx systemctl start nginx |
原文链接:通过yum源快速安装nginx,转载请注明来源!