[root@nginx ~]# #默认启动方式
[root@nginx ~]# which nginx
/sbin/nginx
[root@nginx ~]# nginx
[root@nginx ~]# #另行指定配置文件
[root@nginx ~]# nginx -c /tmp/nginx.conf
[root@nginx ~]# #另行指定配置文件
[root@nginx ~]# nginx -c /tmp/nginx.conf
[root@nginx ~]# #另行指定nginx安装目录
[root@nginx ~]# nginx -p /usr/local/nginx/
[root@nginx ~]# #另行指定全局项启动方式
[root@nginx ~]# nginx -g "pid /var/nginx/test.pid;"
[root@nginx ~]# #测试配置信息是否有错误
[root@nginx ~]# nginx -t
[root@nginx ~]# #测试配置阶段不输出信息
[root@nginx ~]# nginx -t -q
[root@nginx ~]# #显示版本
[root@nginx ~]# nginx -v
nginx version: nginx/1.4.7
[root@nginx ~]# #显示编译阶段的参数
[root@nginx ~]# nginx -V
nginx version: nginx/1.4.7
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --sbin-path=/sbin/nginx --conf-path=/etc/nginx/nginx.conf --with-cc=/usr/bin/gcc --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx --builddir=/user/local/nginx/objs --with-perl=/usr/bin/perl --http-log-path=/var/log/nginx/access.log --user=nginx --group=nginx --http-proxy-temp-path=/tmp/nginx/proxy_temp --with-pcre --with-pcre=/usr/src/pcre --with-openssl=/usr/src/openssl --with-zlib=/usr/src/zlib --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_mp4_module --with-http_flv_module
[root@nginx ~]# #快速的停止服务
[root@nginx ~]# nginx -s stop
[root@nginx ~]# ps -ef | grep nginx
root 20824 1597 0 06:47 pts/0 00:00:00 grep nginx
[root@nginx ~]# nginx
[root@nginx ~]# ps -ef | grep nginx
root 20826 1 0 06:47 ? 00:00:00 nginx: master process nginx
nginx 20827 20826 0 06:47 ? 00:00:00 nginx: worker process
root 20829 1597 0 06:47 pts/0 00:00:00 grep nginx
[root@nginx ~]# k
kbd_mode keytool killall krb5-config
kbdrate kill killall5
[root@nginx ~]# kill -s sigterm 20826 【=nginx -s stop】
[root@nginx ~]# ps -ef | grep nginx
root 20831 1597 0 06:48 pts/0 00:00:00 grep nginx
[root@nginx ~]# #"优雅的方式停止服务"
[root@nginx ~]# nginx -s quit 【=kill -s SIGQUIT <nginx master pid>】 停止worker进程优雅【kill -s SIGWINCH <nginx worker pid>】
[root@nginx ~]# #允许的nginx重读配置文件
[root@nginx ~]# nginx -s reload
[root@nginx ~]# #-s reopen 重新打开日志文件
[root@nginx ~]# nginx -s reopen
[root@nginx ~]# nginx -h

  

nginx的启动与关闭的更多相关文章

  1. nginx的启动和关闭

    nginx的启动和关闭nginx -h 查看帮助信息nginx -v 查看Nginx的版本号nginx -V 显示Nginx的版本号和编译信息start nginx 启动Nginxnginx -s s ...

  2. windows 下 nginx 的启动 停止 关闭

    停止 nginx -s stop 重新加载配置文件(改动了参数无需重启,只有执行重新加载即可)nginx -s reload 退出 停止  关闭nginx -s quit

  3. nginx入门(安装,启动,关闭,信号量控制)

    公司使用到了nginx,于是周末初步接触了一下nginx,立即被其简洁,优雅,高效的特性给迷住了.nginx是在是个好东西,配置极其简单,容易理解,极其高效,稍微一调优,ab测试10k并发,很轻松.比 ...

  4. nginx之旅(第一篇):nginx下载安装、nginx启动与关闭、nginx配置文件详解、nginx默认网站

    一.nginx下载安装 版本nginx 1.15.5 系统环境centos7.5(本机ip192.168.199.228) 关闭selinux 和防火墙firewall 1.下载 wget http: ...

  5. nginx启动、关闭、重启

    1.启动 [root@localhost local]# nginx/sbin/nginx #启动 [root@localhost local]# nginx/sbin/nginx -t #检查配置文 ...

  6. linux nginx启动 重启 关闭命令

    启动操作 nginx -c /usr/local/nginx/conf/nginx.conf -c参数指定了要加载的nginx配置文件路径 停止操作停止操作是通过向nginx进程发送信号来进行的 步骤 ...

  7. (转)Windows下cmd nginx的启动,重启,关闭功能

    转自:http://www.cnblogs.com/derekchen/archive/2011/02/17/1957209.html cls @ECHO OFF SET NGINX_PATH=D:\ ...

  8. 【Nginx】启动,重启,关闭命令

    原文地址 https://github.com/zhongxia245/blog/issues/18欢迎 star nginx启动,重启,关闭命令 时间:2016-09-23 16:52:22 启动 ...

  9. 【Nginx】简介以及安装、启动、关闭

    一.概述 二.Nginx基本安装 2.1 Windows安装Nginx Nginx目录结构 2.2 Linux安装Nginx 2.3 Mac利用homebrew安装 三.nginx启动关闭 3.1 重 ...

随机推荐

  1. 检索 COM 类工厂中 CLSID 为 {} 的组件时失败,原因是出现以下错误: 80070005

    检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005.跟踪了一下,结果是将记录导出 ...

  2. php操作redis常用方法源代码

    1,connect 描述:实例连接到一个Redis.参数:host: string,port: int返回值:BOOL 成功返回:TRUE;失败返回:FALSE 示例: <?php $redis ...

  3. 是否用new来新建对象

    class A{ }: 1.不使用new来新建对象 A a: 使用完后什么也不用做,系统自动调用析构函数.使用空间是栈. 2.使用new来新建对象 A* a=new A();   delete a;/ ...

  4. 网络文件常常提到类似"./run.sh"的数据,这个命令的意义是什么?

    由于命令的执行需要变量的支持,若你的执行文件放置在本目录,并且本目录并非正规的执行文件目录(/bin./usr/bin 等为正规),此时要执行命令就得要严格指定该执行文件."./" ...

  5. 【转载】COM:IUnknown、IClassFactory、IDispatch

    原文:COM:IUnknown.IClassFactory.IDispatch COM组件有三个最基本的接口类,分别是IUnknown.IClassFactory.IDispatch. COM规范规定 ...

  6. WEB前端开发工具的初识

    准备学习BootStrap,然后发现好多插件啊…… 从一个开源项目开始学习吧. required node.js & bower & grunt $ git clone https:/ ...

  7. Java内存模型--JMM简介

    JMM:Java Memory Model(Java内存模型),围绕着在并发过程中如何处理可见性.原子性.有序性这三个特性而建立的模型. 可见性:JMM提供了volatile变量定义,final.sy ...

  8. mongodb .net driver

    1.介绍 The official MongoDB .NET Driver provides asynchronous interaction with MongoDB. Powering the d ...

  9. geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?

    # sample data d <- data.frame(expand.grid(x=letters[1:4], g=factor(1:2)), y=rnorm(8)) # Figure 1a ...

  10. POJ 1142 Smith Numbers(史密斯数)

    Description 题目描述 While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Leh ...