nginx相关命令

栏目: 服务器 · Nginx · 发布时间: 5年前

内容简介:启动代码格式:例如:

启动

启动代码格式: nginx安装目录地址 -c nginx配置文件地址

例如:

[root@LinuxServer sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

停止

nginx 的停止有三种方式:

从容停止

- 1、查看进程号

[root@LinuxServer ~]# ps -ef|grep nginx

- 2、杀死进程

[root@LinuxServer ~]# kill -QUIT 2072

快速停止

  • 1、查看进程号

    [root@LinuxServer ~]# ps -ef|grep nginx
  • 2、杀死进程

    [root@LinuxServer ~]# kill -TERM 2132
       [root@LinuxServer ~]# kill -INT 2132

强制停止

[root@LinuxServer ~]# pkill -9 nginx

重启

  1. 验证nginx配置文件是否正确

    • 方法一:进入 nginx 安装目录 sbin 下,输入命令 ./nginx -t

      显示 nginx.conf syntax is ok
      nginx.conf test is successful
      说明配置文件正确!

    • 方法二:在启动命令 -c 前加 -t
  2. 重启 Nginx 服务

    • 方法一:进入 nginx 可执行目录 sbin 下,输入命令 ./nginx -s reload 即可
    • 方法二:查找当前 nginx 进程号,然后输入命令: kill -HUP 进程号 实现重启nginx服务

以上所述就是小编给大家介绍的《nginx相关命令》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

About Face 3

About Face 3

Alan Cooper、Robert Reimann、David Cronin / John Wiley & Sons / 2007-5-15 / GBP 28.99

* The return of the authoritative bestseller includes all new content relevant to the popularization of how About Face maintains its relevance to new Web technologies such as AJAX and mobile platforms......一起来看看 《About Face 3》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具