Many online tutorials, but nginx not too much, the following installation when the main reference to the article:
Http://54im.com/linux/linux-cacti-cn-install.html
http://www.tecmint.com/install-cacti-network-monitoring-on-rhel-centos-6-3-5-8-and-fedora-17-12/Main
http://tongcheng.blog.51cto.com/6214144/1627590 Journal
http://better.blog.51cto.com/1886029/1199143 Source Installation
There are mysql nginx net-snmp php acati php-fpm
also a variety of installation packages, the installation environment isCentos6.5
My side of the general MySQL Nginx are installed, mainly PHP installation is not familiar with
NET-SNMP, RRDtool installation
netnetnet-snmp-utils
PHP and Dependent packages
# yum install php php-mysql php-snmp php-xml php-gd php-pear php-common php-devel php-mbstring php-cli php-fpm
MySQL User and database setup
mysql>createdefaultsetSELECTINDEXCREATECREATEONTO [email protected]‘%‘BY‘cacti#erya‘;mysql>flush privileges;
Installing cacti
# mkdir /www# cd /www/# wget -c http://www.cacti.net/downloads/cacti-0.8.8c.tar.gz# tar zxvf cacti-0.8.8c.tar.gz# mv cacti-0.8.8c cacti# mysql -ucacti -pcacti#erya -Dcacti < cacti/cacti.sql
Modify Database Configuration
# vim /www/cacti/include/config.php
$database_type"mysql";$database_default"cacti";$database_hostname"localhost";$database_username"cacti";$database_password"cacti#erya";$database_port"3306";$database_sslfalse;
Also have to change the time zone, otherwise the drawing of the picture timeline is not correct. Or is the php.ini set good
date.timezone = Asia/Shanghai
Add Nginx Web users and permissions, not done here, but can be modified later
and set the boot up and so on.
Add Nginx configuration, restart, nginx php-fpm
etc.
server {Listen8080;server_name localhost;Root/www/cacti;location/cacti {Alias/www/cacti;Index Index. PHP;} Location ~ ^/cacti.+\. PHP$ {Fastcgi_pass127.0. 0. 1:9000;Fastcgi_index Index. PHP;Fastcgi_split_path_info ^/cacti (. +\. PHP)(.*)$;Fastcgi_param script_filename/www/cacti/$fastcgi _script_name;Include fastcgi. conf;}}
This configuration is not understood, but can be used
Add a Scheduled task
#vim /etc/cron.d/cacti
*/5 * * * * /usr/bin/php/dev/null2>&1
The basic installation is complete here.
Test Nginx, PHP is useful, here with fastcgi bar, just interface
[[email protected] html]# cat index.php<?phpphpinfo();?>
The problem here is how PHP starts, nginx configuration fastcgi is easy, but the PHP container needs to be installed and recompiled
Continue installation
# yum install php-fpm
This is a service that also needs to be configured
Master Profile/etc/php-fpm.conf Child profile in php-fpm.d/
# /etc/init.d/php-fpm start正在启动 php-fpm: [确定]
Nginx configuration file
Server{Listen 8080;server_namelocalhostRoothtmlIndexindex.php; Location/ {Try_files $uri $uri//index.php$is _args$args; } Location ~ \.php${Try_files $uri=404;includefastcgi.conf;Fastcgi_pass 127.0.0.1:9000; } }
Then access http://192.168.31.206:8080/
can see the PHP information, do not quite understand how to find the php file path
Error
If the following error occurs
-/ to/ A -: .: -[Error]30521#0: *1FastCGI sentinchStdErr"PHP message:php Fatal error:allowed memory size of 536870912 bytes exhausted (tried to allocate 523800 bytes) in/ home/www/cacti/lib/adodb/adodb.inc.php on line 833 " whileReadingResponseHeader from upstream, client:103.254.. 163,Server: localhost,Request:"get/cacti/index.php http/1.1", Upstream:"fastcgi://127.0.0.1:9000", Host:"124.88.61.42:8890"
May be the reason why the database is not initialized
Statement:
This article is from the "Orangleliu Notebook" blog, reproduced please be sure to keep this source http://blog.csdn.net/orangleliu/article/details/45954663 author Orangleliu Use Attribution-NonCommercial-share agreements in the same way
[CACTI]NGINX+PHP+CACTI+MYSQL+PHP-FPM Installation Notes