How to install Cacti on CentOS 7


In this tutorials, we will show you how to install Cacti on CentOS 7.

Requirements :

Install the PHP Modules for Cacti

yum install php-gd php-pear php-common php-cli php-devel php-snmp net-snmp-utils net-snmp-libs rrdtool -y

Create Cacti Database and User

Where the database will be cactidatabase, the user will be cacti and the password, cactipass.

mysql -u root -p
MariaDB> CREATE DATABASE cactidatabase;
MariaDB> GRANT ALL PRIVILEGES ON cactidatabase.* TO 'cacti'@'localhost' IDENTIFIED BY 'cactipass';
MariaDB> exit

Installation of Cacti

yum install epel-release -y
yum install cacti -y

Import Cacti database in your Database Server

Locate Cacti database to import.

rpm -ql cacti|grep cacti.sql

Import the Database in your Database Server

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

Insert the Database informations in the config file

nano /etc/cacti/db.php
database_default = "cactidatabase";
database_hostname = "localhost";
database_username = "cacti";
database_password = "cactipass";

Configure Apache for Cacti

Edit the cacti confg and change the following block to reflect this one.

nano /etc/httpd/conf.d/cacti.conf
<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require all granted
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
Deny from all
Allow from all

Restart your Webserver

systemctl restart httpd.service

Uncomment the crontab line

nano /etc/cron.d/cacti

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

Create the empty cacti log file

mkdir /var/log/cacti
touch /var/log/cacti/cacti.log

Finish your installation online


Colo-Serv Communications has written 20 articles

Premium Dedicated Server in Canada

Leave a Reply

Your email address will not be published. Required fields are marked *

two × 2 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>