存档

‘√nginx’ 分类的存档

让CACTI支持中文显示

2011年2月14日 没有评论

1.安装中文字体
yum -y install fonts-chinese

2.设置apache,使得用户录入的中文保存为UTF8格式,并且让rrdtool的locale为zh_CN.utf8

DirectoryIndex index. index.html
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
AddDefaultCharset UTF-8 增加的


ServerName .viyin.net
ServerAdmin test@admin.com
DocumentRoot “/home/cacti/www”

3.apache指定locale
vim /usr/local/apache/bin/apachectl
HTTPD_LANG=zh_CN.uft8

4.重启apache
/usr/local/apache/bin/apachectl -k restart

5.设置cacit-rrdtool
在cacti的WEB界面选择:Console -> Cacti Settings -> Paths 标签中的:
RRDTool Default Font Path: /usr/share/fonts/chinese/TrueType/msyh.ttf

nginx cache配置

2010年12月6日 2 条评论

编译安装

  1. pcre
  2. wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz
  3. tar zxvf pcre-8.10.tar.gz
  4. cd pcre-8.10/
  5. ./configure
  6. make && make install
  7.  
  8. wget http://labs.frickle.com/files/ngx_cache_purge-1.2.tar.gz
  9.  
  10. wget wget http://www.nginx.org/download/nginx-0.8.53.tar.gz
  11.  
  12. ./configure --user=daemon --group=daemon --add-module=../ngx_cache_purge-1.2 --prefix=/usr/local/nginx/ --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-md5=/usr/lib --with-sha1=/usr/lib --with-http_gzip_static_module

阅读全文…

分类: √nginx 标签: , , ,

Nginx+php-fcgi出现kernel: TCP: time wait bucket table overflow解决方法

2010年8月6日 没有评论

[root@viyin etc]# tail /var/log/messages
Aug 6 11:29:26 viyin : printk: 640 messages suppressed.
Aug 6 11:29:26 viyin kernel: TCP: time wait bucket
Aug 6 11:29:31 viyin kernel: printk: 299 messages suppressed.
Aug 6 11:29:31 viyin kernel: TCP: time wait bucket table overflow
Aug 6 11:29:37 viyin kernel: printk: 590 messages suppressed.
Aug 6 11:29:37 viyin kernel: TCP: time wait bucket table overflow
Aug 6 11:29:41 viyin kernel: printk: 711 messages suppressed.
Aug 6 11:29:41 viyin kernel: TCP: time wait bucket table overflow
Aug 6 11:29:46 viyin kernel: printk: 290 messages suppressed.
Aug 6 11:29:46 viyin kernel: TCP: time wait bucket table overflow

查看80连接状态
[root@viyin ~]# netstat -an | grep 80 | awk ‘{print $6}’ | sort | uniq -c | sort -rn
5539 ESTABLISHED
768 TIME_WAIT
321 FIN_WAIT1
165 FIN_WAIT2
56 LAST_ACK
32 CONNECTED
22 SYN_RECV
5 STREAM
3 LISTEN
1 33410680
修改 /etc/sysctl.conf
sysctl net.ipv4.tcp_max_tw_buckets=10000

nginx限制目录IP访问

2010年6月26日 没有评论

location ~ ^/phpmyadmin/ {
allow 1.1.1.0/24;
allow 2.2.2.2.2/32;
deny all;
index index. index.do index.html index.htm;

location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
}

分类: √nginx, √web 标签: , ,

nginx+fastcgi(11: Resource temporarily unavailable)

2010年6月3日 没有评论

connect() to unix:/tmp/-cgi.sock failed (11: ) while connecting to upstream,

PHP-FPM 配置文件中的:

-1
改成:
1024

参考

http://forum.nginx.org/read.php?3,31467,31467

nagios监控出现It appears as though you do not have permission

2010年5月15日 1 条评论

It appears as though you do not have permission to view information for any of the hosts you requested…

If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.

修改/etc/cgi.cfg
vi /usr/local//etc/cgi.cfg

use_authentication=1 #把1修改为0,保存
root@nagios#/etc/init.d/nagios restart

分类: √nginx 标签:

nginx 限速配置

2010年5月10日 没有评论

在nginx.conf的http{}添加
limit_zone one $binary_remote_addr 10m;

然后在虚拟机里写
location / {
limit_conn one 1; 线程
limit_rate 100k; 速度
}
表示限速100K 每个客户端只允许一个线程

最终速度=rate * conn

分类: √nginx 标签: , ,