Step 1: We recommend that you use the Uubuntuserver system + LAMP service to install the cacti software for the UUbuntu system and LAMP service, because the LAMP service provided by the server system + system will be relatively stable. During Uubuntuserver installation, select and install the LAMP service. If you use Uubuntu on the desktop or the LAMP service is not installed during installation, run the following command to set up the LAMP server first. $ Sudoapt-getins
Step 1: Install UUbuntu and LAMP services
We recommend that you use the Uubuntu server system + LAMP service to install the cacti software, because the server version system + Built-in LAMP service will be relatively stable.
During Uubuntu server Installation, select and install the LAMP service.
If you use Uubuntu on the desktop or the LAMP service is not installed during installation, run the following command to set up the LAMP server first.
$ Sudo apt-get install apache2
$ Sudo apt-get install mysql-server
$ Sudo apt-get install php5
Step 2: Install related components
$ Sudo apt-get install php5-mysql php5-cgi php5-cli php5-snmp php-pear snmp snmpd
$ Sudo apt-get install rrdtool
Step 3: Install the cacti Program
Download the latest cacti package from the http://www.cacti.net website, and Uubuntu server can download it with the wget command.
$ Sudo-s
$ Cacti-version.tar.gz/var/www
$ Cd/var/www
$ Tar xzf cacti-version.tar.gz
$ Mv cacti-version cacti
$ Rm cacti-version.tar.gz
$ Exit
Step 4: related settings
$ Cd/var/www/cacti
$ Sudo mysqladmin-u root-p create cacti
$ Sudo mysql-u root-p cacti <cacti. SQL
$ Sudo mysql-u root-p cacti
Pay attention to this. if you really don't know how to use mysql under the command, you should first create a database with phpmyadmin and then import data. run the command to modify the password of the mysql database.
Grant all on cacti. * to cactiuser @ localhost identified by 'cacti ';
Flush privileges;
Set password for cactiuser @ localhost = password ('cactiuser ');
Quit
Edit/var/www/cacti/include/config. php and change the Database Password to cactiuser.
This is based on the database password you set above
$ Sudo vi/var/www/cacti/include/config. php
$ Database_password = "cactiuser ";
Add cactiuser
$ Sudo useradd cactiuser-d/var/www/cacti-s/bin/false
$ Sudo chown-R cactiuser/var/www/cacti/rra/var/www/cacti/log
The above may not work:
# Sudo chown-hR cactiuser/var/www/cacti/rra/var/www/cacti/log
Edit/etc/crontab.
$ Sudo vi/etc/crontab
*/5 * cactiuser php5/var/www/cacti/poller. php>/dev/null 2> & 1
Next, if you have built the LAMP, do not add it again.
Edit/etc/php5/apache2/php. ini.
$ Sudo vi/etc/php5/apache2/php. ini
; Extension = mysql. so
Edit/etc/php5/cli/php. ini.
$ Sudo vi/etc/php5/cli/php. ini
; Extension = mysql. so
Edit/etc/php5/cgi/php. ini.
$ Sudo vi/etc/php5/cgi/php. ini
; Extension = mysql. so
Restart apache2
$ Sudo/etc/init. d/apache2 restart
This server uses http: // localhost/cacti/for access. Other hosts Use http: // cacti Server IP Address/cacti for access. The default username and password are admin.
User Name: admin
Password: admin