码迷,mamicode.com
首页 > 系统相关 > 详细

Linux - CentOS 7 通过Yum源安装 Nginx

时间:2019-12-05 20:23:25      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:ack   img   pre   type   通过   开机自启动   list   lease   top   

添加源

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

技术图片

安装Nginx

sudo yum install -y nginx

技术图片

直到出现 Complete! 

启动

sudo systemctl start nginx.service

启动后在浏览器上访问,网页出现以下内容说明安装成功。

技术图片

Nginx常用命令

查看版本:nginx -v

查看nginx安装目录:ps  -ef | grep nginx

检查配置文件:nginx -t

启动:systemctl start nginx.service

停止:systemctl stop nginx.service

重新:systemctl restart nginx.service

设置开机自启动:systemctl enable nginx.service

停止开机自启动:systemctl disable nginx.service

查看当前状态:systemctl status nginx.service

查看所有已启动的服务:systemctl list-units --type=service

Linux - CentOS 7 通过Yum源安装 Nginx

标签:ack   img   pre   type   通过   开机自启动   list   lease   top   

原文地址:https://www.cnblogs.com/tenghao510/p/11990353.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!