Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS6.8 installation Cacti0.8.8h (tested)

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Environment:

CentOS-6.8-x8664-minimal

cacti-0.8.8h.tar.gz

There are certain security problems in cacti system. It is strongly recommended to deploy it in intranet environment!

Update the system first

yum -y install wget vim-enhancedmkdir /etc/yum.repos.d/backupmv /etc/yum.repos.d/{.repo,backup}wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.163.com/.help/CentOS6-Base-163.repowget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repoyum clean allyum makecacheyum -y update

1. Install LAMP

install MySQL

yum install -y mysql-server mysql-client mysql-devel

Install httpd service

yum -y install httpd

Install php services

yum -y install php php-mysql

Check whether the above software is installed successfully (should be 10)

rpm -qa |egrep 'php|httpd|mysql'mysql-5.1.73-7.el6.x8664php-common-5.3.3-48.el68.x8664php-pdo-5.3.3-48.el68.x8664php-5.3.3-48.el68.x8664mysql-libs-5.1.73-7.el6.x8664 mysql-server-5.1.73-7.el6.x8664httpd-tools-2.2.15-54.el6.centos.x8664httpd-2.2.15-54.el6.centos.x8664php-cli-5.3.3-48.el68.x8664php-mysql-5.3.3-48.el68.x8664

Install required library files

yum -y install zlib freetype libjpeg fontconfig gd libxml2 zlib freetype libjpeg fontconfig gd libxml2 php-gd gcc net-snmp-devel mysql-devel dos2unix autoconf

2. Install rrd tool

yum -y install rrdtool rrdtool-devel

3. Install and configure snmp tools required for monitoring

yum -y install net-snmp net-snmp-devel net-snmp-utils

Configure snmp (monitor the machine itself, which can be used as a plot verification after installation)

vim /etc/snmp/snmpd.conf com2sec notConfigUser default public changed to: com2sec notConfigUser 127.0.0.1 public access notConfigGroup "" any noauth exact systemview none changed to: access notConfigGroup "" any noauth none none none included .1 80 Remove comments

4. Start the service and add such as boot start

service httpd startservice mysqld startservice snmpd startchkconfig httpd onchkconfig mysqld onchkconfig snmpd on

5. Install cacti

wget https://www.cacti.net/downloads/cacti-0.8.8h.tar.gztar zxf cacti-0.8.8h.tar.gz -C /var/www/html/cd /var/www/html/mv cacti-0.8.8h/ /var/www/html/cacti

6. initialize the database

mysql -u rootcreate database cacti;grant all on cacti. to cacti@localhost identified by 'admin@123';grant all on cacti. to cacti@'127.0.0.1' identified by 'admin@123';flush privileges;use cacti;source /var/www/html/cacti/cacti.sql;quit

7. Set the time zone of php.ini (otherwise not shown)

vim /etc/php.inidate.timezone = Asia/Shanghai

8. Configure cacti

vim /var/www/html/cacti/include/config.php $databasetype = "mysql";$databasedefault = "cacti";$databasehostname = "localhost";$databaseusername = "cacti";$databasepassword = "admin@123";$databaseport = "3306";

9. Set permissions and schedule tasks.

useradd cacti -d /var/www/html/cacti -s /sbin/nologinchown -R cacti /var/www/html/cacti/rra /var/www/html/cacti/logecho '/5 root /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1' >> /etc/crontab

10. Install Spine Polling Plugin

Download--> Unzip--> Go to Directory--> Install

wget https://www.cacti.net/downloads/spine/cacti-spine-0.8.8h.tar.gztar zxcf cacti-spine-0.8.8h.tar.gzcd cacti-spine-0.8.8h.tar.gz./ configuremake&&make installcp /usr/local/spine/etc/spine.conf.dist /etc/spine.confspine -vvim /etc/spine.confDBHost localhostDBDatabase cactiDBUser cactiDBPass admin@123DBPort 3306

test

/usr/local/spine/bin/spine

Next configure the cacti graphical tool (installed by default in/usr/local/spine/sbin/spine, linked to/sbin/spine):

Console -> Configureation -> Settings -> Alternate Poller Path -> Spine Poller File Path

Console -> Cacti Settings -> Poller -> Poller Type

Then modify the scheduled tasks from once every 5 minutes to once every minute

/5 php /opt/cacti/cacti/poller.php > /dev/null 2>&1

changed to

/1 php /opt/cacti/cacti/poller.php > /dev/null 2>&1

11. Restart all services

service httpd restartservice mysqld restartservice snmpd restart

13. complete the installation

http://localhost/cacti

The username is admin, the password defaults to admin, and the password is required to be modified for the first time.

troubleshooting

1. No pictures:

/var/www/html/cacti

Directory empowerment 777, wait 5 minutes for polling.

2. Not shown yet:

mysqluse cacti;select count(*) from polleroutput; truncate table polleroutput;select count(*) from polleroutput;

Finally rebuild the cache.

3. Change to Chinese support

--Change rrdtool version number to 1.2.x;

--Copy the font file MSYH.ttf into/usr/share/fonts/and authorize 777;

--cacti page, change default font path to/usr/share/fonts/MSYH.ttf;

--Modify vim/var/www/html/cacti/lib/functions.php to add:

setlocale(LCCTYPE,"zhCN.UTF-8");

Restart the httpd service.

Attached:

For example, the cacti platform requires changing the default port number (e.g., 10010) and making whitelist restrictions (e.g., only allowing IP address 123.123.123.123 to log in). The relevant settings are as follows

1. Change port number

vim /etc/httpd/conf/httpd.conf

Change Listen:80 to Listen:10010 under line 137, save exit.

2. Firewall releases port number 10010

vim /etc/sysconfig/iptables

add firewall rules

-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

Restart firewall services

service iptables restart

3. Whitelist access restrictions

vim /etc/httpd/conf/httpd.conf

Under line 318, add the following and save exit

Order allow,denyAllow from 123.123.123.123

Restart httpd service

service httpd restart

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report