前面部分的Nginx安装请参照我的文章《基于Nginx搭建的smokeping监控及配置》,在此不作重述。
Cacti部署:默认安装位置/usr/share/nginx/html/cacti
修改nginx配置文件 vi /etc/nginx/conf.d/default.conf
增加对cacti的支持(对应自己的nginx安装目录 yum安装就在/usr/share/nginx/html下)
vi /etc/nginx/conf.d/default.conf在文件末尾大括号内添加如下配置
location /cacti {
root /usr/share/nginx/html;
index index.html index.htm index.php;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
location ~ \.php$ {
fastcgi_buffer_size 128k;
fastcgi_buffers 8 128k;
root html;