[root@king01 ~]# rpm -ivh epel-release-6-8.noarch.rpm [root@king01 ~]# rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm [root@king01 ~]# yum install -y httpd php php-mysql php-gd libjpeg libjpeg-devel libpng libpng-devel [root@king01 ~]# yum install -y net-snmp net-snmp-utils net-snmp-devel help2man rrdtool cacti
[root@king01 ~]# rpm -ivh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm [root@king01 ~]# yum install -y mysql-community-server [root@king01 ~]# vi /etc/my.cnf [mysqld] port = 3306 user = mysql character-set-server=utf8 explicit_defaults_for_timestamp sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES open-files-limit = 65535 max_connections = 500 max_connect_errors = 10000 key_buffer_size = 256M max_allowed_packet = 16M read_buffer_size = 1M read_rnd_buffer_size = 1M sort_buffer_size = 1M join_buffer_size = 1M tmp_table_size = 256M max_heap_table_size = 256M table_open_cache = 512 thread_cache_size = 64 slow_query_log = 1 long_query_time = 5 log-queries-not-using-indexes log_bin = mysql-bin binlog_format = row sync_binlog = 1 binlog_cache_size = 16M max_binlog_cache_size = 32M max_binlog_size = 512M expire_logs_days = 7 relay_log = relay-bin relay_log_recovery = 1 master_info_repository = table relay_log_info_repository = table innodb_buffer_pool_size = 2G innodb_buffer_pool_instances = 2 innodb_log_file_size = 128M innodb_log_files_in_group = 3 innodb_log_buffer_size = 16M innodb_undo_logs= 128 innodb_undo_tablespaces = 3 innodb_file_format = Barracuda innodb_strict_mode = 1 innodb_data_file_path = ibdata1:1024M:autoextend [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash default-character-set = utf8 [client] default-character-set = utf8 [root@king01 ~]# service mysqld start [root@king01 ~]# mysql_secure_installation
[root@king01 ~]# vim /etc/httpd/conf/httpd.conf ServerName 192.168.1.201:80 [root@king01 ~]# vim /etc/php.ini date.timezone = Asia/Shanghai
[root@king01 ~]# vim /etc/httpd/conf.d/cacti.conf Alias /cacti /usr/share/cacti <Directory /usr/share/cacti/> <IfModule mod_authz_core.c> # httpd 2.4 Require host localhost </IfModule> <IfModule !mod_authz_core.c> # httpd 2.2 Order deny,allow Deny from all Allow from all </IfModule> </Directory> [root@king01 ~]# /etc/init.d/httpd start Starting httpd: [ OK ]
[root@king01 ~]# mysql -uroot -pabcd.1234 mysql> create database cacti default character set utf8; Query OK, 1 row affected (0.26 sec) mysql> grant all on cacti.* to 'cacti'@'localhost' identified by 'cacti'; Query OK, 0 rows affected (0.09 sec) mysql> grant select on mysql.time_zone_name to 'cacti'@'localhost'; Query OK, 0 rows affected (0.09 sec) [root@king01 ~]# mysql -uroot -p cacti < /usr/share/doc/cacti-1.1.19/cacti.sql [root@king01 ~]# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
[root@king01 ~]# vi /usr/share/cacti/include/config.php $database_type = 'mysql'; $database_default = 'cacti'; $database_hostname = 'localhost'; $database_username = 'cacti'; $database_password = 'cacti'; $database_port = '3306'; $database_ssl = false;
[root@king01 ~]# tar zxvf cacti-spine-1.1.19.tar.gz [root@king01 ~]# cd cacti-spine-1.1.19 [root@king01 cacti-spine-1.1.19]# ./configure [root@king01 cacti-spine-1.1.19]# make & make instal
[root@king01 ~]# cd /usr/local/spine/etc [root@king01 etc]# mv spine.conf.dist spine.conf [root@king01 etc]# vim spine.conf DB_Host localhost DB_Database cacti DB_User cacti DB_Pass cacti DB_Port 3306 RDB_Host localhost RDB_Database cacti RDB_User cacti RDB_Pass cacti RDB_Port 3306
[root@king01 ~]# crontab -e */5 * * * * /usr/bin/php /usr/share/cacti/poller.php
原文地址:http://blog.51cto.com/13598811/2103132