Skip to content

Instantly share code, notes, and snippets.

@parallaxhub
Last active October 28, 2022 08:25
Show Gist options
  • Save parallaxhub/88bcbea3ce7d3e5b0db9fbb74c998dde to your computer and use it in GitHub Desktop.
Save parallaxhub/88bcbea3ce7d3e5b0db9fbb74c998dde to your computer and use it in GitHub Desktop.
Cacti Installation
apt-get update -y
apt-get install snmp php-snmp rrdtool librrds-perl unzip curl git gnupg2 -y
###Install LAMP Server
apt-get install apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-ldap php-mbstring php-gd php-gmp -y
nano /etc/php/7.4/apache2/php.ini
#Change the following lines: and time zong according your country timezone date and time
memory_limit = 512M
max_execution_time = 60
date.timezone = Asia/Kolkata
nano /etc/php/7.4/cli/php.ini
#Change the following lines:
memory_limit = 512M
max_execution_time = 60
date.timezone = Asia/Kolkata
systemctl restart apache2
###Configure MariaDB Server
nano /etc/mysql/mariadb.conf.d/50-server.cnf
mysql -u root -p
create database cacti;
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser';
flush privileges;
exit;
mysql mysql < /usr/share/mysql/mysql_test_data_timezone.sql
mysql -u root -p
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
flush privileges;
exit;
###Install and Configure Cacti
wget https://www.cacti.net/downloads/cacti-latest.tar.gz
tar -zxvf cacti-latest.tar.gz
mv cacti-1* /var/www/html/cacti
mysql cacti < /var/www/html/cacti/cacti.sql
touch /var/www/html/cacti/log/cacti.log
chown -R www-data:www-data /var/www/html/cacti/
chmod -R 775 /var/www/html/cacti/
##Configure Apache for Cacti
nano /etc/apache2/sites-available/cacti.conf
Add the following lines:
Alias /cacti /var/www/html/cacti
<Directory /var/www/html/cacti>
Options +FollowSymLinks
AllowOverride None
<IfVersion >= 2.3>
Require all granted
</IfVersion>
<IfVersion < 2.3>
Order Allow,Deny
Allow from all
</IfVersion>
AddType application/x-httpd-php .php
<IfModule mod_php.c>
php_flag magic_quotes_gpc Off
php_flag short_open_tag On
php_flag register_globals Off
php_flag register_argc_argv On
php_flag track_vars On
# this setting is necessary for some locales
php_value mbstring.func_overload 0
php_value include_path .
</IfModule>
DirectoryIndex index.php
</Directory>
a2ensite cacti
systemctl restart apache2
@parallaxhub
Copy link
Author

2.mp4

Screenshot from 2022-10-27 14-59-09
Screenshot from 2022-10-27 15-17-49
Screenshot from 2022-10-27 15-18-16
Screenshot from 2022-10-27 15-18-27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment