在CentOS 6上安装Nginx 1.8(通过SCL)
首先
使用软件集合(SCL)在CentOS6上安装Nginx1.8
参考:快速入门-软件集合
支持
如果使用本方法进行部署,根据Red Hat Customer Portal上的Red Hat Software Collections产品生命周期,预计2018年11月将不再受支持。
之后可能不会对报告的漏洞和问题进行修复。
日志
提交存储库
# yum install -y centos-release-scl
安装
# cat /etc/redhat-release
CentOS release 6.10 (Final)
# yum install -y rh-nginx18
# scl enable rh-nginx18 bash
... 略
Nginx启动/停止
# service rh-nginx18-nginx start
Starting nginx: [ OK ]
# service rh-nginx18-nginx status
nginx (pid 190) is running...
# service rh-nginx18-nginx stop
Stopping nginx: [ OK ]
# service rh-nginx18-nginx status
nginx is stopped
使用nginx自動啟動/停用設定
# chkconfig rh-nginx18-nginx on
# chkconfig --list rh-nginx18-nginx
rh-nginx18-nginx 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# chkconfig rh-nginx18-nginx off
# chkconfig --list rh-nginx18-nginx
rh-nginx18-nginx 0:off 1:off 2:off 3:off 4:off 5:off 6:off
确认的种类繁多。
# which nginx
/opt/rh/rh-nginx18/root/usr/sbin/nginx
# nginx -v
nginx version: nginx/1.8.1
# yum info rh-nginx18
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: ty1.mirror.newmediaexpress.com
* centos-sclo-rh: ty1.mirror.newmediaexpress.com
* centos-sclo-sclo: ty1.mirror.newmediaexpress.com
* extras: ty1.mirror.newmediaexpress.com
* updates: ty1.mirror.newmediaexpress.com
Installed Packages
Name : rh-nginx18
Arch : x86_64
Version : 2.1
Release : 4.el6
Size : 0.0
Repo : installed
From repo : centos-sclo-rh
Summary : Package that installs rh-nginx18
License : GPLv2+
Description : This is the main package for rh-nginx18 Software Collection.