通过yum源快速安装nginx

发表于 2018-02-20   |   分类于 dedecms

使用yum源直接安装nginx

1、配置nginx源

centos6:

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

centos7:

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

2、安装nginx(默认会安装最新的稳定版)

yum -y install nginx

3、默认配置文件

/etc/nginx/nginx.conf

4、设置开机自启及启动nginx

centos6:

chkconfig nginx on
service nginx start

centos7:

systemctl enable nginx
systemctl start nginx
© 2019 Powered by Typecho & Theme Quark