I. Nginx 安装 1.1 RHEL及其衍生版 For RHEL/CentOS : https://nginx.org/en/linux_packages.html#RHEL 1.1.1 安装必备组件 1 sudo yum install yum-utils 1.1.2 设置 yum 存储库 1 vim /etc/yum.repos.d/nginx.repo 粘贴以下内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true [nginx-mainline] name=nginx mainline repo baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/ gpgcheck=1 enabled=0 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true 1.1.3 更新软件包缓存信息 1 sudo dnf makecache 1.1.4 Nginx 安装 1 sudo dnf install nginx 1.1.5 开机自启 1 systemctl enable nginx --now 1.1.6 版本查看 参考文档:Nginx CommandLine (WiKi )
...