Nginx 安装

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

2020-04-29 · 2 分钟 · 913 字 · Mortal