暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

centos8安装Nginx

程序猿白糖 2020-06-02
383

yum 方式安装nginx

1. 执行如下命令进行yum安装nginx

yum install nginx

安装过程需要输入确认信息,全部y 回车即可 ssl_module 也已具备 SSL证书使用需求

安装完成后 查看版本信息

# 查看nginx版本
nginx -v

#查看安装目录文件
rpm -ql nginx

#查看部署目录
whereis nginx

#查看nginx的配置文件的目录
nginx -t

#查看帮助信息
nginx -h

查询得出 usr/sbin/nginx 为 nginx 程序 etc/nginx/nginx.conf为 nginx 配置文件查看nginx是否成功启动

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进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论