ITeye博客

uginx

共 2 篇文章

编写每天定时切割Nginx日志的脚本

1、创建脚本/usr/local/nginx/sbin/cut_nginx_log.sh,输入以下内容: #!/bin/bash # This script run at 00:00 # The Nginx logs path logs_path="/usr/local/nginx/logs/" mkdir -p ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/ mv ${logs_path}access.log ${logs_path}$(date -d "yesterday" +"%Y")/$(d…

2014-11-20 16:21 · uginx

不中断服务平滑修改Nginx配置

①、修改/usr/local/nginx/conf/nginx.conf配置文件后,请执行以下命令检查配置文件是否正确: /usr/local/nginx/sbin/nginx -t 如果屏幕显示以下两行信息,说明配置文件正确: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok the configuration file /usr/local/nginx/conf/nginx.conf was tested successfully ②、这时,输入以下命令查看Nginx主进程号: ps -ef | gr…

2014-11-20 16:20 · uginx