3阶段

centos7.x 安装 nginx

2019-02-26  本文已影响70人  Elvmx
image.png
  1. sudo yum install yum-utils

  2. 新建 /etc/yum.repos.d/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

    [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

  3. sudo yum-config-manager --enable nginx-mainline

  4. sudo yum install nginx

  5. nginx -v 校验是否安装成功

  6. nginx 启动

nginx 的默认html页面放在以下位置

/usr/share/nginx/html
上一篇下一篇

猜你喜欢

热点阅读