zoukankan      html  css  js  c++  java
  • nginx的启动与关闭

    [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
    

      

  • 相关阅读:
    php 下载保存文件保存到本地的两种实现方法
    MySQL select语句直接导出数据
    Go学习笔记03-附录
    Go学习笔记02-源码
    Go学习笔记01-语言
    Go语言极速入门手册
    最简单的抓取网络图片或音乐文件
    使用PHP生成PDF文档
    Oracle常用函数
    ORACLE常用数值函数、转换函数、字符串函数
  • 原文地址:https://www.cnblogs.com/similarface/p/5469785.html
Copyright © 2011-2022 走看看