yum 方式安装nginx
1. 执行如下命令进行yum安装nginx
yum install nginx
安装完成后 查看版本信息
# 查看nginx版本
nginx -v
#查看安装目录文件
rpm -ql nginx
#查看部署目录
whereis nginx
#查看nginx的配置文件的目录
nginx -t
#查看帮助信息
nginx -h
ps -ef | grep nginx
开机启动
#开机启动nginx服务
systemctl enable nginx.service
#查询服务是否开机启动
systemctl is-enabled servicename.service
#开机运行服务
systemctl enable nginx.service
#取消开机运行
systemctl disable nginx.service
#启动服务
systemctl start nginx.service
#停止服务
systemctl stop nginx.service
#重启服务
systemctl restart nginx.service
#重新加载服务配置文件
systemctl reload nginx.service
#查询服务运行状态
systemctl status nginx.service
#显示启动失败的服务
systemctl --failed
文章转载自程序猿白糖,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。