• 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
    

      

  • 相关阅读:
    BZOJ 2002 [Hnoi2010]Bounce 弹飞绵羊(分块)
    BZOJ 4241 历史研究(分块)
    BZOJ 3110 [Zjoi2013]K大数查询(整体二分)
    hdu 5412 CRB and Queries(整体二分)
    POJ2104 K-th Number(整体二分)
    luogu P3157 [CQOI2011]动态逆序对(CDQ分治)
    陌上开花(CDQ分治)
    BZOJ 1176[Balkan2007]Mokia(CDQ分治)
    BZOJ 3626 LCA(离线+树链剖分+差分)
    bzoj1592 Making the Grade
  • 原文地址:https://www.cnblogs.com/similarface/p/5469785.html
Copyright © 2020-2023  润新知