在CentOS 6上使用SCL安装Nginx 1.10

首先

使用Software Collection(SCL)在CentOS6上安装Nginx1.10
父文章:Nginx各种安装方法和EOL摘要
参考:快速入门-软件集合

支持

如果采用这种方法,根据红帽软件集产品生命周期-红帽客户门户的消息,2020-04应该被认为已经到了终止支持(EOL)的阶段。之后可能不会对报告的漏洞和问题进行修复。

记录

注册存储库

# yum install -y centos-release-scl

安装

# cat /etc/redhat-release
CentOS release 6.10 (Final)

# yum install -y rh-nginx110
# scl enable rh-nginx110 bash
... 略

启动/停止Nginx。

# service rh-nginx110-nginx start
Starting nginx:                                            [  OK  ]

# service rh-nginx110-nginx status
nginx (pid 191) is running...
# service rh-nginx110-nginx stop
Stopping nginx:                                            [  OK  ]

# service rh-nginx110-nginx status
nginx is stopped

自動启动配置/解除配置的Nginx。

# chkconfig rh-nginx110-nginx on

# chkconfig --list  rh-nginx110-nginx
rh-nginx110-nginx        0:off   1:off   2:on    3:on    4:on    5:on    6:off
# chkconfig rh-nginx110-nginx off

# chkconfig --list  rh-nginx110-nginx
rh-nginx110-nginx        0:off   1:off   2:off   3:off   4:off   5:off   6:off

不同的确认方式

# which nginx
/opt/rh/rh-nginx110/root/usr/sbin/nginx

# nginx -v
nginx version: nginx/1.10.2

# yum info rh-nginx110
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-nginx110
Arch        : x86_64
Version     : 1.10
Release     : 8.el6
Size        : 0.0
Repo        : installed
From repo   : centos-sclo-rh
Summary     : Package that installs rh-nginx110
License     : GPLv2+
Description : This is the main package for rh-nginx110 Software Collection.
广告
将在 10 秒后关闭
bannerAds