美文网首页
Nginx安装

Nginx安装

作者: 梧桐树下挨过打 | 来源:发表于2020-12-27 01:02 被阅读0次

    Nginx

    一、安装Nginx

    创建镜像源

    vi/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
    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
    

    yum-config-manager --enable nginx-mainline

    二、安装nginx

    yum install nginx -y
    

    三、自启动

    systemctl start nginx
    systemctl enable nginx
    

    四、Nginx http 共享文件无法访问root等目录

    vi /etc/selinux/config
    
    
    
    
    
    

    相关文章

      网友评论

          本文标题:Nginx安装

          本文链接:https://www.haomeiwen.com/subject/rjinnktx.html