How to Install Cacti from EPEL on RHEL 6

Install EPEL repository

rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Install required packages

yum --enablerepo=rhel-6-server-optional-rpms install cacti mysql-server

Configure MySQL

chkconfig mysqld on

/usr/bin/mysql_secure_installation

mysql> create database cacti;
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'password';
mysql> flush privileges;
mysql> quit

mysql -u root -p cacti < /usr/share/doc/cacti-0.8.8h/cacti.sql

Configure Cacti

vi /etc/cacti/db.php

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "password";
$database_port = "3306";
$database_ssl = false;

Configure Apache

vi /etc/httpd/conf.d/cacti.conf

<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 localhost
                Allow from 192.168.1.0/24
        </IfModule>
</Directory>

/etc/init.d/httpd restart

Configure Cron

vi /etc/cron.d/cacti

*/5 * * * * cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Configure IPptables

vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

/etc/init.d/iptables restart

Resources