yum install -y httpd php php-mysql php-snmp php-xml mysql mysql-server cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel net-snmp-utils gcc wget man make perl-CPAN perl-ExtUtils-MakeMaker perl-ExtUtils-MakeMaker-Coverage crontabs xorg-x11-fonts-100dpi xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi ntp php-gd rrdtool
1.
fc-cache -vfs
mysqladmin --user=root password mypassword
mysqladmin --user=root --password reload
# Install and Configure Cacti
mkdir -p /var/www/html/cacti
cd /var/www/html/
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
tar zxvf cacti-0.8.8a.tar.gz
mv cacti-0.8.8a cacti
cd cacti
cd /var/www/html/cacti/cacti-0.8.8a
2.
service mysqld start
chkconfig mysqld on
#import Cacti SQL
mysqladmin -u root -p mypassword create cacti
mysql -u root -pmypassword cacti < cacti.sql
mysql -u root -pmypassword
# MySQL command
mysql> GRANT ALL ON cacti.* TO admin@localhost IDENTIFIED BY 'adminpassword';
mysql> flush privileges;
3.
更改config.php成我們MySQL的username, password與url path,如下:
vi include/config.php
$database_username = "admin";
$database_password = "adminpassword";
$url_path = "/cacti/";
4.
更改目錄權限
chown -R apache:apache /var/www/html/cacti
chown -R admin /var/www/html/cacti/rra/ /var/www/html/cacti/log/
5.
crontab -e
*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
service crond restart
service httpd start
chkconfig httpd on
chkconfig httpd on
No comments:
Post a Comment