nginx常用命令

启动:
cd /usr/local/nginx/sbin
./nginx
nginx服务启动后默认的进程号会放在/usr/local/nginx/logs/nginx.pid文件
cat nginx.pid 查看进程号

关闭:
kill -TERM pid  快速停止服务
kill -QUIT pid  平缓停止服务
kill -9 pid     强制停止服务

重启:
cd /usr/local/nginx
./nginx -HUP pid
./nginx -s reload

另外一些常见的命令:
./nginx -h 查看nginx所有的命令参数
Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -T            : test configuration, dump it and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /usr/local/nginx/)
  -c filename   : set configuration file (default: conf/nginx.conf)
  -g directives : set global directives out of configuration file

./nginx -v  显示nginx的版本号
./nginx -V  显示nginx的版本号和编译信息
./nginx -t  检查nginx配置文件的正确性
./nginx -t  检查nginx配置文件的正确定及配置文件的详细配置内容
./nginx -s  向主进程发送信号,如:./nginx -s reload 配置文件变化后重新加载配置文件并重启nginx服务
./nginx -p  设置nginx的安装路径
./nginx -c  设置nginx配置文件的路径

nginx启动、关闭、重启及常用的命令的更多相关文章

  1. nginx启动,重启,关闭命令

    nginx启动,重启,关闭命令 停止操作停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的步骤1:查询nginx主进程号ps -ef | grep nginx在进程列表 ...

  2. Ubuntu下Nginx启动、停止等常用命令

    本文详细介绍Ubuntu下Nginx启动.停止等常用命令.在开发过程中,我们会经常的修改Nginx的配置文件,每次修改配置文件都可以先测试下本次修改的配置文件是否正确,可以利用以下命令: servic ...

  3. [linux] 小问题:管道符,换行问题等;[nginx]启动,重启,关闭命令;以及升级nginx切换命令

    Lniux换行问题 后面回车不会马上执行本条命令而是换行继续. : 是运行完前面就继续后面的, && 同样是前面正确就运行后面, || 是前面运行不正确就运行后面. | 管道符“|”将 ...

  4. nginx 启动、重启、关闭命令

    一.启动 cd /usr/local/nginx/sbin ./nginx 二.重启 更改配置重启nginx kill -HUP 主进程号或进程号文件路径    或者cd /usr/local/ngi ...

  5. nginx 启动、重启、关闭

    一.启动 cd usr/local/nginx/sbin./nginx 二.重启 更改配置重启nginx kill -HUP 主进程号或进程号文件路径或者使用cd /usr/local/nginx/s ...

  6. nginx启动、重启、关闭

    一.启动 cd usr/local/nginx/sbin ./nginx 二.重启 更改配置重启nginx kill -HUP 主进程号或进程号文件路径 或者使用 cd /usr/local/ngin ...

  7. nginx启动,重启,关闭

    1.nginx启动: a.     /usr/path/sbin/nginx -c [/etc/path/nginx.conf] 中括号中为指定加载的配置文件,不指定则加载默认配置文件 b.     ...

  8. Nginx启动关闭和重启、文档直接下载不阅览

    nginx启动相关 启动:sbin/nginx -c conf/nginx.conf 关闭:sbin/nginx -s stop 重启(重新加载配置文件):sbin/nginx -s reload 检 ...

  9. nginx启动、重启、关闭、升级

    一.启动 cd usr/local/nginx/sbin ./nginx 二.重启 更改配置重启nginx kill -HUP 主进程号或进程号文件路径 或者使用 cd /usr/local/ngin ...

随机推荐

  1. XML scriptlet 连接数据库

    <%@ page language="java" contentType="text/html" pageEncoding="GBK" ...

  2. JS中substring()的用法

    例一: <script type="text/javascript"> var str="Hello world!" document.write( ...

  3. package和import语句_4

    J2SDK中主要的包介绍   java.lang—包含一些Java语言的核心类,如String.Math.Integer.System和 Thread,提供常用功能. java.awt—包含了构成抽象 ...

  4. dfs(最长路径)

    http://poj.org/problem?id=1154 LETTERS Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: ...

  5. python学习第七天流程控制循环while和循环for区别

    流程控制循环是任何编程语言都有一种循环结构,在python while 和break continue 搭配使用,还一种while ....else ......,for循环有序列表和字符串 whil ...

  6. Zookeeper之启动常见错误及解决方法

    Zookeeper启动后,有时候没有真正的启动,那我们如何查找错误呢,就可以查看zookeeper目录下面的zookeeper.out文件,就可以查看到错误了.zookeeper.out文件比较的重要 ...

  7. 使用onfocus与onblur实现搜索框附加信息

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. socket - Linux 套接字

    总览 #include <sys/socket.h> mysocket = socket(int socket_family, int socket_type, int protocol) ...

  9. java this关键字的用法

  10. Redis服务器中有75%受到恶意软件感染

    尽管由于配置错误的服务器和应用程序而导致新的网络攻击不断出现,但人们仍然忽略安全警告. 近两个月前,中国知名黑客组织东方联盟研究人员警告说,一项针对开放Redis服务器的大规模恶意软件活动现在已经发展 ...