centos平台nginx截断js
admin | nginx | 2014-07-03
今天发生发现一个很恶心的问题,nginx把js截断了,浏览器加载js文件 加载了一部分服务器拒绝响应了,而且刚开始正常,运行一段时间出问题!!!
经过 N次调试 看到日志文件的一个报错
[crit] 27599#0: *1618 open() "/usr/local/nginx/proxy_temp/0/06/0000000060" failed (13: Permission denied) while reading upstream
nginx 自动 对js进... [阅读全文]
linux下mysql定时备份数据库
转自:http://my.oschina.net/qqapi/blog/32923
一、用命令实现备份
首页进入mysql的bin目录
1、备份数据
#mysqldump -uusername -ppassword discuz > discuz_2010-04-01.sql
这样就把discuz数据库所有的表结构和数据备份到discuz_2010-04-01.sql里了,
如果数据量大会占用很大空间,这时可以利用gzip压缩数据,
命令如下:
... [阅读全文]
Nginx Rewrite 规则相关指令
admin | nginx | 2012-12-22
Nginx Rewrite 规则相关指令有 if 、rewrite、set 、return、break等。
break 指令
使用环境:server,location,if
该指令的作用是完成当前的规则集,不在处理rewrite指令。
示例如下:
if ($slow) {
limit_rate 10k;
break;
}
if 指令
使用环境:server,location
一下信息可以被指定为条件:
1、变量名,错误的值包括:空字符串"",... [阅读全文]
nginx切割日志并使用awstats分析
admin | nginx | 2012-12-20
#!/bin/bash
#function:cut nginx log files for lnmp v0.5 and v0.6
#author: http://lnmp.org
#set the path to nginx log files
log_files_path="/usr/local/nginx/logs/"
log_files_dir=${log_files_path}history/$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")
#set ngin... [阅读全文]
Nginx 安装与配置
admin | nginx | 2012-12-20
系统:Centos 6.0
下载nginx(nginx-1.2.4.tar.g) http://nginx.org/
下载pcre(pcre-8.31.tar.gz) http://pcre.org/
一、安装之前首先确认系统中是否已安装gcc、openssl-devel、pcre-devel、zlib-devel
#yum -y install gcc openssl-devel pcre-devel zlib-devel libtool gcc-c++
#安装make
#yum -y install gcc automake... [阅读全文]
Nginx: error while loading shared libraries: libpcre.so.1
admin | nginx | 2012-12-17
ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1
前面在一般的linux上可以解决此问题.
注: 在有的操作系统上面,安装pcre后,安装的位置为/usr/local/lib/*pcre*
在redhat 64位机器之上有这样的情况.
在redhat 64位机器上, nginx可能读取的pcre文件为/lib64/libpcre.so.1文件.
所以在改用下面的软连接:
ln -s /usr/local/lib/libpcre.s... [阅读全文]
nginx反向代理SMTP,POP3,IMAP jsp认证
admin | nginx | 2012-11-22
nginx 配置
-------------------------------------------------------------
mail {
auth_http 127.0.0.1:8080/auth.jsp;
pop3_capabilities "TOP" "USER";
imap_capabilities "IMAP4rev1" "UIDPLUS";
server {
listen 110;
protocol pop3;
proxy on;
}
server {
listen 143;
protocol imap;
proxy on;
}
server {
listen 25... [阅读全文]
nginx经验积累配置
admin | nginx | 2012-04-27
Gcc autoconf automake自动完善Makefile
yum -y install gcc gcc-c++ autoconf automake
nginx 依赖模块
gzip模块zlib库
rewrite模块pcre库
ssl模块openssl库
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
#编译参数
./configure --with-http_stub_status_module --with-http_ssl_module --with-mai... [阅读全文]