一、默认情况CentOS 7中无Nginx的源,现在Nginx官网提供了CentOS的源地址,可以如下执行命令添加源:

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

  

二、安装Nginx

# yum install -y nginx

   

三、启动Nginx并设置开机自动运行

# systemctl start nginx.service     //启动服务
# systemctl enable nginx.service    //开机自动运行

  

 四、停止Nginx服务

# systemctl stop nginx.service

  

 参考资料:https://www.cnblogs.com/songxingzhu/p/8568432.html

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2021-06-11
  • 2022-02-15
  • 2022-02-04
猜你喜欢
  • 2022-01-04
  • 2022-02-19
  • 2021-07-11
  • 2022-12-23
  • 2021-10-10
  • 2022-02-07
相关资源
相似解决方案