# CentOS 7 - Configuring Cacti

## Install Required Dependencies

```
yum -y install mariadb-server php php-cli php-mysql net-snmp-utils rrdtool php-snmp gcc mariadb-devel net-snmp-devel autoconf automake libtool dos2unix
```

## Enable Required Services for Cacti

```
chkconfig httpd on<br></br>chkconfig mariadb on<br></br>chkconfig crond on
```

## Download and Extract Cacti

cd /var/www/html   
wget http://www.cacti.net/downloads/cacti-0.8.8c.tar.gz   
tar -xzvf cacti-0.8.8c.tar.gz

## Setting Up Cacti for Apache

### Add Cacti User &amp; Enable Cron Jobs

```
adduser cacti<br></br>echo "*/5 * * * * cacti php /var/www/html/cacti/poller.php &>/dev/null" >> /etc/cron.d/cacti
```

### Fix Cacti Directory Permission

```
cd /var/www/html/cacti<br></br>chown -R cacti.apache rra log<br></br>chmod 775 rra log
```

### Set Up Cacti Database

```
mysql -p cacti < /var/www/html/cacti/cacti.sql<br></br>GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'MyV3ryStr0ngPassword'; <br></br>flush privileges; <br></br>exit<br></br>cd /var/www/html/cacti/include/ <br></br>vi config.php (and change $database_* configuration and $url_path)
```

## Open Firewall Ports to HTTP and HTTPS

```
firewall-cmd --permanent --zone=public --add-service=https <br></br>firewall-cmd --permanent --zone=public --add-service=http <br></br>firewall-cmd --reload
```

Login to cacti using admin:admin and go to “Console -&gt; System Utilities” and click on “Rebuild Poller Cache” after the first login!