-
sudo yum install yum-utils
-
新建
/etc/yum.repos.d/nginx.repo
文件。并复制下面内容进去
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key -
sudo yum-config-manager --enable nginx-mainline
-
sudo yum install nginx
-
nginx -v 校验是否安装成功
-
nginx 启动
nginx 的默认html页面放在以下位置
/usr/share/nginx/html
网友评论