quit is a graceful shutdown. Nginx finishes serving the open connections before shutdowntcp
quit 是一个优雅的关闭方式,Nginx在退出前完成已经接受的链接请求。
stop is a quick shutdown where is terminates in between serving the connection
stop 是快速关闭,无论有没有正在处理的请求。
官网参考:https://www.nginx.com/resources/wiki/start/topics/tutorials/commandline/
nginx -s reload :修改配置后从新加载生效
nginx -s reopen :从新打开日志文件
nginx -t -c /path/to/nginx.conf 测试nginx配置文件是否正确
关闭nginx:
nginx -s stop :快速中止nginx
quit :完整有序的中止nginx
其余的中止nginx 方式:
ps -ef | grep nginx
kill -QUIT 主进程号 :从容中止Nginx
kill -TERM 主进程号 :快速中止Nginx
pkill -9 nginx :强制中止Nginx
启动nginx:
nginx -c /path/to/nginx.conf
平滑重启nginx:
kill -HUP 主进程号
变量别名:
alias: 编辑 vi ~/bashrc
alias wpw='cd /home/websites/www'
alias logapi='cd /home/websites/www/api/application/logs'
alias tailapi="tail -f /home/websites/www/api/application/logs/log-$(date +%Y-%m-%d).php"
linux环境变量:
一、可用export命令查看PATH值
# export
二、单独查看PATH环境变量
# echo $PATH
三、添加PATH环境变量(临时),可用
#export PATH=/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH
四、永久性添加环境变量(影响当前用户)
#vim ~/.bashrc
export PATH="/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH"
demo以下:
export LANG="zh_CN.UTF-8"
export log="log-all-$(date +%Y-%m-%d).php"
export mlog="log-m-all-$(date +%Y-%m-%d).php"
5.永久添加环境变量(影响全部用户)# vim /etc/profile在文档最后,添加:export PATH="/opt/STM/STLinux-2.3/devkit/sh4/bin:$PATH"保存,退出,而后运行:#source /etc/profile