---
title: "Install Cacti For RedHat Linux 5.6"
author: "uu4u"
date: "2011-04-27T21:45:33Z"
tags: []
categories: ["编程语言"]
slug: "install-cacti-for-redhat-linux-5-6"
draft: false
lastmod: "2011-04-27T21:45:33Z"
id: 1020443
url: "https://uu4u.iteye.com/blog/1020443"
---

# [Install and Configure Cacti]()

 

1. Extract the distribution tarball.
   
   ```
   shell> tar xzvf cacti-version.tar.gz
   ```
2. Create the MySQL database:
   
   ```
   shell> mysqladmin --user=root create cacti
   ```
3. Import the default cacti database:
   
   ```
   vim cacti.sql
   ```
   
   ```
   replace TYPE=MyISAM with ENGINE=MyISAM
   ```
   
   ```
   :%s/TYPE=MyISAM/ENGINE=MyISAM/g     [全局替换]
   ```
   
   ```
   shell> mysql -u root -ppassword
   ```
   
   ```
   mysql>use cacti;
   ```
   
   ```
   mysql>source /cacti_real_path/cacti.sql
   ```
4. Optional: Create a MySQL username and password for Cacti.
   
   ```
   shell> mysql --user=root mysql
   mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
   mysql> flush privileges;
   ```
5. Edit `include/config.php` and specify the database type, name, host, user and password for your Cacti configuration.
   
   ```
   $database_type = "mysql";
   $database_default = "cacti";
   $database_hostname = "localhost";
   $database_username = "cactiuser";
   $database_password = "cacti";
   ```
6. Set the appropriate permissions on cacti's directories for graph/log generation. You should execute these commands from inside cacti's directory to change the permissions.
   
   ```
   shell> chown -R cactiuser rra/ log/
   ```
   
   (Enter a valid username for **cactiuser**, this user will also be used in the next step for data gathering.)
7. Add a line to your `/etc/crontab` file similar to:
   
   ```
   */5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
   ```
   
   Replace **cactiuser** with the valid user specified in the previous step.
   
   Replace `/var/www/html/cacti/` with your full Cacti path.
8. Point your web browser to:
   
   []()
   
   > http://your-server/cacti/
   
   Log in the with a username/password of **admin**. You will be required to change this password immediately. Make sure to fill in all of the path variables carefully and correctly on the following screen.