Centos7安装nignx

来源:互联网 发布:玩客云 知乎 编辑:程序博客网 时间:2024/05/17 02:03

Centos7安装nignx


  1. 安装epel源,默认源有好多软件无法安装

    sudo yum install epel-release

  2. 安装nignx

    sudo yum install nginx

  3. 启动nignx

    sudo systemctl start nginx

  4. 关闭nignx

    sudo systemctl enable nginx

  5. 加入开机启动

    sudo systemctl enable nginx

服务配置

  • 服务器根路径 /usr/share/nginx/html
  • 默认配置文件路径 /etc/nginx/conf.d/default.conf
  • 虚拟服务器配置路径 /etc/nginx/conf.d/*.conf
  • 全局配置路径 /etc/nginx/nginx.conf
0 0
原创粉丝点击