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配置文件的路径
转载请注明原文地址: https://www.6miu.com/read-81334.html