美文网首页
CentOS7 安装nginx

CentOS7 安装nginx

作者: cfwwcf | 来源:发表于2017-01-09 07:03 被阅读0次

    1、安装epel与remi

    sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm

    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

    补充:如果无法下载可以到

    http://dl.fedoraproject.org/pub/epel/7/x86_64/e/

    http://rpms.famillecollet.com/enterprise/

    去找寻相对应的文件。

    重要:如果是在网络有问题,我们可以尝试使用aliyun的源

    a)备份CentOS-Base.repo文件

    sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

    (将CentOS-Base.repo文件拷贝成CentOS-Base.repo.bak)

    b)下载aliyun的CentOS-Base.repo文件

    sudo wget -O /etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repo

    2、安装nginx

    sudo yum install nginx -y

    安装完成后,在浏览器中输入:localhost如果看到nginx的信息,则表明安装成功。

    相关文章

      网友评论

          本文标题:CentOS7 安装nginx

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