CentOS7.2安装Nginx的方法步骤

2019-01-16 23:35:28于海丽

nginx -t

打印如下:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful

说明配置文件成功!

centos7.0+ nginx实现停止、启动、重启

在CentOS7中,进行chkconfig命令操作时会发现有类似“systemctl.....”的提示,systemctl可以简单实现service和chkconfig的结合,这样通过一个命令就可以实现两个命令的功能。

systemctl命令的基本操作格式是:

systemctl [OPTIONS...] {COMMAND}...

以nginx服务为例,实现停止、启动、重启的动作如下:

systemctl stop nginx.service systemctl start nginx.service systemctl restart nginx.service

检查服务状态

systemctl status nginx.service

使服务开机启动

systemctl enable nginx.service

取消服务开机启动

systemctl disable nginx.service

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易采站长站。

您可能感兴趣的文章:

centos6.5通过yum安装nginxCentos 6.5 64位中Nginx详细安装部署教程CentOS7 Docker Nginx部署及运行详解centos6.5服务器安装Nginx设置服务和开机自启的方法centos6.5下Nginx简单安装教程CentOS 7中利用yum安装Nginx的方法教程详解如何在CentOS7中使用Nginx和PHP7-FPM安装NextcloudCentOS6.3添加nginx系统服务的实例详解