1.安装中文字体
yum -y install fonts-chinese
2.设置apache,使得用户录入的中文保存为UTF8格式,并且让rrdtool的locale为zh_CN.utf8
DirectoryIndex index.php index.html
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
AddDefaultCharset UTF-8 增加的
ServerName cacti.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
[root@viyin etc]# tail /var/log/messages
Aug 6 11:29:26 viyin kernel: printk: 640 messages suppressed.
Aug 6 11:29:26 viyin kernel: TCP: time wait bucket table overflow
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
location ~ ^/phpmyadmin/ {
allow 1.1.1.0/24;
allow 2.2.2.2.2/32;
deny all;
index index.php 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;
}
}
connect() to unix:/tmp/php-cgi.sock failed (11: Resource temporarily unavailable) while connecting to upstream,
PHP-FPM 配置文件中的:
-1
改成:
1024
参考
http://forum.nginx.org/read.php?3,31467,31467
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/nagios/etc/cgi.cfg
use_authentication=1 #把1修改为0,保存
root@nagios#/etc/init.d/nagios restart
在nginx.conf的http{}添加
limit_zone one $binary_remote_addr 10m;
然后在虚拟机里写
location / {
limit_conn one 1; 线程
limit_rate 100k; 速度
}
表示限速100K 每个客户端只允许一个线程
最终速度=rate * conn