分类:
2008-09-27 17:34:11
The Cacti Manual
Ian Berry
Tony Roman
Larry Adams
J.P. Pasnak, CD
Jimmy Conner
Reinhard Scheck
This section covers some general installation instructions. Detailed OS specific installation instructions are available for and
Cacti requires that the following software is installed on your system.
RRDTool 1.0.49 or 1.2.x or greater
MySQL 3.23 or greater, 4.0.20d or greater highly recommended for advanced features
PHP 4.1 or greater, 4.3.6 or greater highly recommended for advanced features
Packages for RPM-based Operating Systems
httpd
php
php-mysql
php-snmp
mysql
mysql-server
net-snmp
Ports for FreeBSD
www/apache2
net/rrdtool
Cacti requires that the following software is installed on your system.
RRDTool 1.0.49 or 1.2.x or greater
MySQL 3.23 or greater, 4.0.20d or greater highly recommended for advanced features
PHP 4.1 or greater, 4.3.6 or greater highly recommended for advanced features
Packages for RPM-based Operating Systems
httpd
php
php-mysql
php-snmp
mysql
mysql-server
net-snmp
Ports for FreeBSD
www/apache2
net/rrdtool
net/net-snmp
www/php4-cgi
lang/php4 (With MySQL and SNMP Support)
databases/mysql323-server
net/net-snmp
www/php4-cgi
lang/php4 (With MySQL and SNMP Support)
databases/mysql323-server
Extract the distribution tarball.
shell> tar xzvf cacti-version.tar.gz
Create the MySQL database:
shell> mysqladmin --user=root create cacti
Import the default cacti database:
shell> mysql cacti < cacti.sql
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;
Edit include/config.php and specify the MySQL user, password and database for your Cacti configuration.
$database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cacti";
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.)
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.
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.)
Edit your PHP Config File at /etc/php.ini to allocate sufficient memory for Cacti:
memory_limit=128m
Point your web browser to:
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.
Software Compoents Required
(Optional) Apache> - This software is optional if running Windows Internet Information Server.
Cacti> - Install from the zip distribution and intstall in the web root or your choice. Many choose to install into a "Cacti" sub folder.
Cactid - Install from the zip distribution into the c:\cacti directory. Make sure your cactid.conf.dist is located in that directory as well.
RRDTool - Install from the Cacti website. Install it into the c:\cacti directory.
PHP 4.3.6+ or 5.x - Install into the c:\php folder. If you choose to install into c:\Program Files\php, you will have to use 8.3 filenames to reference it's binaries in Cacti.
MySQL 4.x or MySQL 5.x - Install into the default location. This is typically c:\Program Files\MySQL\MySQL Server X.XX.
(Optional) Cygwin - Download and execute setup.exe from the Cygwin website. Keep the setup.exe file for later use.
(Optional) Net-SNMP - Install to the c:\net-snmp directory. If you choose to use c:\Program Files\net-snmp you will have tu use 8.3 filenames to reference it's binaries in Cacti.
Configure PHP
If using PHP 4, move the files in c:\php\dlls to c:\php
Add the following directory to the existing Windows System PATH environment variable: c:\php. The Windows path can be accessed via the Control Panel at: System | Advanced | Environment Variables | System Variables.
Add the following directory to a new Windows System environment variable called PHPRC: c:\php.
Add a new Windows System environment variable called MIBDIRS. If using PHP 4, set it to c:\php\mibs. If using PHP 5, set it to c:\php\extras\mibs
If using PHP 4.3.5 or less, create the following directory c:\tmp.
Rename the file c:\php\php.ini.dist to php.ini, and make the following changes to it:
If using PHP 4 add/uncomment the following lines.
extension_dir = c:\php\extensions extension=php_snmp.dll extension=php_sockets.dll cgi.force_redirect = 0
If using PHP 5 uncomment the following lines.
extension_dir = c:\php\ext extension=php_mysql.dll extension=php_snmp.dll extension=php_sockets.dll cgi.force_redirect = 0
You must configure PHP to have sufficient memory to return database rows. In order to accomplish that, you must set the memory_limit variable.
memory_limit=128m
If using PHP 4.3.5 or less include the following line. If using 4.3.6 or greater, you should remove this line if present.
session.save_path=c:\tmp
In earlier installation guides to PHP, they recommended moving certain DLL's to the c:\winnt\system32 directory. If so, you will have to remove those files. Please review the PHP installation documentation for instructions on removing those files.
If you want to allow template importing, uncomment the following line:
file_uploads = On
Give the user who will be running the scheduled task, modify rights to the .index file in the location pointed to by the MIBDIRS Windows System environment variable.
Configure the Webserver (Apache)
Make sure you have stopped any IIS web servers before you proceed with Apache installation, or make sure Apache is configured on an alternate port.
If you are using Apache 1.3.x, installation of PHP 5 is not recommended. If using PHP 4, add the following lines to your httpd.conf file. You can edit that file by selecting Start | All Programs | Apache HTTP Server X.XX | Configure Server | Edit the httpd.conf file pick from the Taskbar.
If using Apache 1.3.x and PHP 4, then add the following lines:
LoadModule php4_module c:\php\sapi\php4apache.dll AddModule mod_php4.c AddType application/x-httpd-php .php DirectoryIndex index.html index.htm index.php
If using Apache 2.x and PHP 4, then add the following lines:
LoadModule php4_module c:\php\sapi\php4apache2.dll AddType application/x-httpd-php .php DirectoryIndex index.html index.htm index.php
If using Apache 2.x and PHP 5, then add the following lines.
LoadModule php5_module c:\php\php5apache2.dll AddType application/x-httpd-php .php DirectoryIndex index.html index.htm index.php
Configure the Webserver (IIS)
Sta