Professional Documents
Culture Documents
Cacti Install Centos
Cacti Install Centos
Apache Install
A basic Apache install is very easy:
# yum -y install httpd mod_ssl
Oddly, the server does not start automatically when you install it so you have to do this by hand:
# /usr/sbin/apachectl start
The first thing you will see is this error:
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name,
# using 127.0.0.1 for ServerName
As you can see, the address 127.0.0.1 (or whatever address you see there, usually your main IP address)
is used as the server name by default. It's a good idea to set the ServerName for the next time the server
is started.
Open the main Apache config:
# nano /etc/httpd/conf/httpd.conf
Towards the end of the file you'll find a section that starts with ServerName and gives the example:
#ServerName www.example.com:80
All you need to do is enter your Cloud Server host name or a fully-qualified domain name:
SeerverName cacti3.uprm.edu
Note that my Cloud Server host name is cacti3.uprm.edu.
Now just reload Apache:
# /usr/sbin/apachectl restart
And the warning has gone.
Disable Firewall
HowTo Disable The Iptables Firewall in Linux
Task: Disable / Turn off Linux Firewall (Red hat/CentOS/Fedora Core)
Type the following two commands (you must login as the root user):
# /etc/init.d/iptables save
# /etc/init.d/iptables stop
Turn off firewall on boot:
# chkconfig iptables off
Default Page
If you navigate to your Cloud Server IP address:
http://123.45.67.89
You will see the default CentOS Apache welcome screen.
Chkconfig
Now that we have Apache installed and working properly, we need to make sure that it's set to start
automatically when the Cloud Server is rebooted.
# /sbin/chkconfig httpd on
Let's check our work to confirm:
# /sbin/chkconfig --list httpd
httpd
0:off
PHP5 Install
Let's move on to the PHP5 install. I'm not going to install all the modules available, just a few common
ones so you get the idea.
As before, due to using yum to install PHP5, any dependencies are taken care of:
# yum -y install php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc phpxml php
Once done, reload Apache:
# /usr/sbin/apachectl restart
RRDtool install
# yum groupinstall "Development tools"
# yum -y install cairo-devel pango-devel libxml2-devel
#wget "http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.8.tar.gz"
# cp rrdtool-1.4.8.tar.gz /usr/local/
#cd /usr/local
# tar zxf rrdtool-1.4.8.tar.gz
# cd ./rrdtool-1.4.8/
# ./configure --prefix=/usr/local/rrdtool-1.4.8
# make
# make install
# ln -s /usr/local/rrdtool-1.4.8 /usr/local/rrdtool
# echo '/usr/local/rrdtool/lib' > /etc/ld.so.conf.d/rrdtool.conf
# /sbin/ldconfig
SNMP install
# yum -y install net-snmp net-snmp-utils
# cd /etc/snmp
# cp snmpd.conf snmpd.conf.original
Cacti Install
# yum -y install mysql mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start
# mysql_secure_installation
Install CACTI
#cd /
# cd /usr/local
# wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
# tar zxf cacti-0.8.7g.tar.gz
# chown -R root:root /usr/local/cacti-0.8.7g
# ln -s /usr/local/cacti-0.8.7g /usr/local/cacti
# cd ./cacti/
# mysql -u cactiuser -p cacti < cacti.sql
# cd /usr/local/cacti/include/
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "PASSWORD";
$database_port = "3306";
#cd /
# cd /usr/local/cacti
# chown apache rra
# echo -e '*/5 * * * * apache /usr/bin/php /usr/local/cacti/poller.php >/dev/null 2>&1'
>/etc/cron.d/cacti
# cd /etc/httpd/conf.d/
Add the following text in new file cacti.conf
# nano cacti.conf
Alias /cacti /usr/local/cacti
<Directory /cacti>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 136.145.33.0/24
</Directory>
RewriteEngine on
Note: Proceed to create WLC device and verify its acquire data.
Spine Install
# cd /
# yum -y install net-snmp-devel mysql-devel openssl-devel
# cd /usr/local/
# wget "http://www.cacti.net/downloads/spine/cacti-spine-0.8.7g.tar.gz"
# tar zxf cacti-spine-0.8.7g.tar.gz
# cd cacti-spine-0.8.7g
# ./configure --prefix=/usr/local/cacti-spine-0.8.7g
# make
# make install
localhost
DB_Database
cacti
DB_User
cactiuser
DB_Pass
krakat0a
DB_Port
3306
DB_PreG
GUI
Go to Console > Configuration > Settings > Paths > Alternate Poller Path > Spine Poller File Path:
/usr/local/cacti-spine-0.8.7g/bin/spine > save
Console > Configuration > Settings > Poller > General > Poller Type: spine > save
Architecture install
#cd /
# cd /usr/local/
# wget http://www.cacti.net/downloads/pia/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
# tar -zvxf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
****Important NOTE: Backup your cacti directory********
# cd cacti-plugin-arch
# cd files-0.8.7g
# cp -Rf * /usr/local/cacti/
# nano /usr/local/cacti-0.8.7g/include/config.php
Edit config.php and verify if the database type, name, host, user and password for your Cacti
configuration. The $plugins array is required for using the Plugin Architecture (PIA) only. Add the
following line to the config.php file:
GUI
Go to Console, Utilities, User Management, select user. Under Real Permissions select Plugin
Management.
#wget http://docs.cacti.net/_media/plugin:mactrack-v2.9-1.tgz
rrdtool
References:
http://www.rackspace.com/knowledge_center/article/centos-apache-and-php-install
http://www.cyberciti.biz/faq/turn-on-turn-off-firewall-in-linux/
http://forums.cacti.net/viewtopic.php?f=12&t=43852
http://pooh.gr.jp/?p=9492
http://www.adminsehow.com/2010/11/install-snmp-on-centosrhel/
http://docs.cacti.net/manual:087:1_installation.9_pia