Cacti name-based virtual host for Apache

29 Jan

I wanted to monitor my networking gear using Cacti. Below is my Apache httpd.conf to use name-based virtual hosting.
CentOS / RHEL:

sudo nano /etc/httpd/conf/httpd.conf (needed to uncomment the following line)

NameVirtualHost *:80

sudo nano /etc/httpd/conf.d/cacti.conf (add the virtual host lines around the existing Directory ones..and change to your network address subnet)

<VirtualHost *:80>

DocumentRoot /usr/share/cacti

<Directory /usr/share/cacti/>
Order Deny,Allow
Allow from

LogLevel warn
ErrorLog logs/
CustomLog logs/ combined


To make the changes take effect: sudo /sbin/service httpd reload

To make sure the httpd service restarts at boot: sudo /sbin/chkconfig httpd on

Also don’t forget to turn on the Cacti cronjob that polls the devices,use sudo nano /etc/cron.d/cacti and uncomment the following line:  */5 * * * *     cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

To get a better understanding on DNS issues and Apache read: HERE

One thought on “Cacti name-based virtual host for Apache

Leave a Reply

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