Linux - CentOS 7 通过Yum源安装 Nginx
添加源
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
相关推荐
张立军的架构之路 2020-09-28
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10