CentOS-7 部署Django----安装Nginx

CentOS-7 部署Django----安装Nginx

在CentOS-7上部署Nginx步骤:

截至此时,Nginx的稳定版本为1.14,已下安装版本为1.14

1、yum的存储库中不存在nginx信息,所以需要预添加:

  官方的源:# rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

  国内的源:# yum install epel-release -y  

  我使用了第一个,国内源没试过

    

2、安装nginx:

  # yum install -y nginx

3、安装nginx服务并开启:

  # systemctl enable nginx.service

  # systemctl start nginx.service

    

4、停止和重启nginx:

  # systemctl stop nginx.service

  # systemctl restart nginx.service

5、卸载nginx:

  # yum remove -y nginx

6、测试:

  在浏览器敲上服务器的公网IP,即可看到Nginx的欢迎页:

    

猜你喜欢

转载自www.cnblogs.com/lambs/p/9348365.html
今日推荐