linux快速安装Nginx
-
安装yum依赖程序
yum install -y yum-utils
-
添加nginx的yum仓库
cd /etc/yum.repos.d/
-
配置相应信息保存并退出
vim nginx.repo
-
将下边的信息复制粘贴并保存退出
[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
-
安装nginx
yum install -y nginx
-
如果出现获取 GPG 密钥失败:进行下载再进行导入key
wget https://nginx.org/keys/nginx_signing.key --no-check-certificate rpm --import nginx_signing.key
-
启动并查看状态文章来源:https://www.toymoban.com/news/detail-617359.html
systemctl start nginx systemctl status nginx
-
查看并关闭防火墙状态文章来源地址https://www.toymoban.com/news/detail-617359.html
systemctl status firewalld systemctl stop firewalld
到了这里,关于linux快速安装Nginx的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!