Professional Documents
Culture Documents
Cacti Instalando CentOS
Cacti Instalando CentOS
Cacti Instalando CentOS
19
Installing on CentOS 7
LAMP (Linux, Apache, MySQL/MariaDB, PHP)
Required packages
2. Install Apache
3. Enable and start the service to ensure it starts when the system reboots
# For example:
p
# On httpd 2.4, change "Require host localhost" to "Require all granted".
Cacti®
# On httpd 2.2, change "Allow from localhost" to "Allow from all".
Release 1.2.19
<VirtualHost *:443>
LogLevel warn
ServerName cacti.yourdomain.com
ServerAdmin admin@yourdomain.com
DocumentRoot "/var/www/html/cacti"
SSLEngine On
SSLCertificateFile /etc/ssl/certs/YourOwnCertFile.crt
SSLCertificateKeyFile /etc/ssl/private/YourOwnCertKey.key
<Directory /var/www/html/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
</IfModule>
</Directory>
<Directory /var/www/html/cacti/install>
# mod_security overrides.
# Uncomment these if you use mod_security.
#SecRuleRemoveById 960010
# permit the specification of the RRDtool paths during install
#SecRuleRemoveById 900011
</Directory>
# These sections marked "Require all denied" (or "Deny from all")
<Directory /var/www/html/cacti/log>
<IfModule mod_authz_core.c>
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
</IfModule>
</Directory>
Cacti®
<IfModule mod_authz_core.c>
Release 1.2.19
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
</IfModule>
</Directory>
</VirtualHost>
Database Server
The choice between MySQL server and MariaDB is normally down to the OS
maintainers if you use
one of the predefined LAMP setup installations. If you
are deciding between these yourself, you
should research this via your
favorite search engine.
Whilst MySQL is the original open source SQL database server created in 1995
which is now
owned by Oracle, MariaDB is designed as a drop-in replacement by
some of the original MySQL
developers / owners. This will likely continue to
be a drop-in alternative until there is a major
divergence that can not be
bridged.
MySQL
1. Install MySQL server
2. Enable and start the service to ensure it starts when the system reboots
MariaDB
1. Install MariaDB server
2. Enable and start the service to ensure it starts when the system reboots
/usr/bin/mysql_secure_installation
vim /etc/my.cnf.d/server.cnf
[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
innodb_file_format = Barracuda
max_allowed_packet = 16777777
join_buffer_size = 32M
innodb_file_per_table = ON
innodb_large_prefix = 1
innodb_buffer_pool_size = 250M
innodb_additional_mem_pool_size = 90M
innodb_flush_log_at_trx_commit = 2
log-error = /var/log/mysql/mysql-error.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/log/mysql/mysql-slow.log
|
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
# mysql -u root -p
Database changed
Common packages
PHP
PHP and various packages are all required by Cacti for successful operation
Cacti®
php-xml php-zip
Release 1.2.19
date.timezone = Pacific/Auckland
RRDtool
RRDtool is required to store the data retrieved from devices in .rra files to
produce the graphs
which are shown within Cacti
SNMP
SNMP is used to query most devices for information.
Cacti
The following steps will show you how to manually download, install and
configure the basics for
Cacti.
cd /tmp
wget https://www.cacti.net/downloads/cacti-1.y.z.tar.gz
mv -v cacti-1.y.z /var/www/html/cacti
mv -v /var/www/html/cacti/include/config.php-dist /var/www/html/cacti/include/config
3. Update database_ fields with your own details. This section only applies
to the Main Cacti
Server
$database_type = 'mysql';
Cacti®
$database_default = 'your_cacti_database';
Release 1.2.19
$database_hostname = 'localhost';
$database_username = 'your_cacti_username';
$database_password = 'your_cacti_password';
$database_port = '3306';
$database_ssl = false;
$database_ssl_key = '';
$database_ssl_cert = '';
$database_ssl_ca = '';
Starting with Cacti 1.2.16, you have the option to use either the
legacy Crontab entry, or an
optional cactid units file and server
to run your Cacti pollers.
For systemd unit's file install, you will need to modify the
included units file to following your
install location
and desired user and group's to run the Cacti poller as.
To complete the task,
follow the procedure below:
touch /etc/sysconfig/cactid
cp -p /var/www/html/cacti/service/cactid.service /etc/systemd/system
Spine
1. Install the necessary packages to compile and install spine
wget https://www.cacti.net/downloads/spine/cacti-spine-1.y.z.tar.gz
cd cacti-spine-1.y.z
# ./configure
config/install-sh -c -d '/usr/local/spine/bin'
config/install-sh -c -d '/usr/local/spine/etc'
config/install-sh -c -d '/usr/local/spine/share/man/man1'
4. Edit spine.conf
mv -v /usr/local/spine/etc/spine.conf.dist /usr/local/spine/etc/spine.conf
vi /usr/local/spine/etc/spine.conf
DB_Host localhost
DB_Database your_cacti_database
DB_User your_cacti_username
DB_Pass your_cacti_password
DB_Port 3306
#DB_UseSSL 0
#RDB_SSL_Key
#RDB_SSL_Cert
#RDB_SSL_CA
getenforce
setenforce 0
setenforce 1
Note: If you installed Cacti out of /var/www/html make sure you fix up
all SELinux context and
permissions.
GitHub
API
Back to top
Donate
RRDtool
Copyright © 2004-2021 The Cacti Group, Inc. - Cacti is the registered trademark The Cacti Group,
Inc.
Made by BV IT Solutions Ltd.