CentOS安装部署Cacti
2015-06-26 02:23
585 查看
1.安装epel源;
[root@Cacti ~]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@Cacti ~]# rpm -ivh epel-release-6-8.noarch.rpm
2.安装apache,mysql,php,php-snmp,net-snmp,rrdtool;
[root@Cacti ~]# yum install -y httpd httpd-devel mysql mysql-server php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-mysql php-snmp net-snmp-utils net-snmp-libs php-pear-Net-SMTP rrdtool
3.启动服务并设置开机启动;
[root@Cacti ~]# /etc/init.d/httpd start
[root@Cacti ~]# /etc/init.d/mysqld start
[root@Cacti ~]# /etc/init.d/snmpd start
[root@Cacti ~]# chkconfig httpd on
[root@Cacti ~]# chkconfig mysqld on
[root@Cacti ~]# chkconfig snmpd on
4.安装cacti;
[root@Cacti ~]# yum install -y cacti
5.配置mysql;
[root@Cacti ~]# mysqladmin -u root password "123456"
[root@Cacti ~]# mysql -u root -p123456
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database cacti;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'centos';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> exit;
Bye
[root@Cacti ~]# rpm -ql cacti | grep cacti.sql
/usr/share/doc/cacti-0.8.8b/cacti.sql
[root@Cacti ~]# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
[root@Cacti ~]# vim /etc/cacti/db.php
26 $database_type = "mysql";
27 $database_default = "cacti";
28 $database_hostname = "localhost";
29 $database_username = "cacti";
30 $database_password = "centos";
31 $database_port = "3306";
32 $database_ssl = false;
6.配置apache服务;
[root@Cacti ~]# vim /etc/httpd/conf.d/cacti.conf
14 <Directory /usr/share/cacti/>
15 <IfModule mod_authz_core.c>
16 # httpd 2.4
17 Require host localhost
18 </IfModule>
19 <IfModule !mod_authz_core.c>
20 # httpd 2.2
21 Order deny,allow
22 Deny from all
23 Allow from 192.168.1.0/24
7.编辑cron cacti;
[root@Cacti ~]# vim /etc/cron.d/cacti
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1 #取消注释
8.开启cacti web页面安装;
访问地址:http://服务器ip/cacti
![](http://s3.51cto.com/wyfs02/M00/6E/F2/wKiom1WMRnzzmaWaAAMkdB9qj3o911.jpg)
![](http://s3.51cto.com/wyfs02/M02/6E/F2/wKiom1WMRpChT0cXAAEpCLqIeLI137.jpg)
![](http://s3.51cto.com/wyfs02/M01/6E/EE/wKioL1WMSGHAi_qZAAN0XwjNh8g117.jpg)
![](http://s3.51cto.com/wyfs02/M00/6E/EE/wKioL1WMSHyzVHIKAAD713nQYfc844.jpg)
默认用户名密码都是admin。
![](http://s3.51cto.com/wyfs02/M00/6E/F2/wKiom1WMRtzwPpj5AAJi1GH9584705.jpg)
本文出自 “jerry在路上” 博客,请务必保留此出处http://jerry0117.blog.51cto.com/1664014/1665770
[root@Cacti ~]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@Cacti ~]# rpm -ivh epel-release-6-8.noarch.rpm
2.安装apache,mysql,php,php-snmp,net-snmp,rrdtool;
[root@Cacti ~]# yum install -y httpd httpd-devel mysql mysql-server php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-mysql php-snmp net-snmp-utils net-snmp-libs php-pear-Net-SMTP rrdtool
3.启动服务并设置开机启动;
[root@Cacti ~]# /etc/init.d/httpd start
[root@Cacti ~]# /etc/init.d/mysqld start
[root@Cacti ~]# /etc/init.d/snmpd start
[root@Cacti ~]# chkconfig httpd on
[root@Cacti ~]# chkconfig mysqld on
[root@Cacti ~]# chkconfig snmpd on
4.安装cacti;
[root@Cacti ~]# yum install -y cacti
5.配置mysql;
[root@Cacti ~]# mysqladmin -u root password "123456"
[root@Cacti ~]# mysql -u root -p123456
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database cacti;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'centos';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> exit;
Bye
[root@Cacti ~]# rpm -ql cacti | grep cacti.sql
/usr/share/doc/cacti-0.8.8b/cacti.sql
[root@Cacti ~]# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
[root@Cacti ~]# vim /etc/cacti/db.php
26 $database_type = "mysql";
27 $database_default = "cacti";
28 $database_hostname = "localhost";
29 $database_username = "cacti";
30 $database_password = "centos";
31 $database_port = "3306";
32 $database_ssl = false;
6.配置apache服务;
[root@Cacti ~]# vim /etc/httpd/conf.d/cacti.conf
14 <Directory /usr/share/cacti/>
15 <IfModule mod_authz_core.c>
16 # httpd 2.4
17 Require host localhost
18 </IfModule>
19 <IfModule !mod_authz_core.c>
20 # httpd 2.2
21 Order deny,allow
22 Deny from all
23 Allow from 192.168.1.0/24
7.编辑cron cacti;
[root@Cacti ~]# vim /etc/cron.d/cacti
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1 #取消注释
8.开启cacti web页面安装;
访问地址:http://服务器ip/cacti
![](http://s3.51cto.com/wyfs02/M00/6E/F2/wKiom1WMRnzzmaWaAAMkdB9qj3o911.jpg)
![](http://s3.51cto.com/wyfs02/M02/6E/F2/wKiom1WMRpChT0cXAAEpCLqIeLI137.jpg)
![](http://s3.51cto.com/wyfs02/M01/6E/EE/wKioL1WMSGHAi_qZAAN0XwjNh8g117.jpg)
![](http://s3.51cto.com/wyfs02/M00/6E/EE/wKioL1WMSHyzVHIKAAD713nQYfc844.jpg)
默认用户名密码都是admin。
![](http://s3.51cto.com/wyfs02/M00/6E/F2/wKiom1WMRtzwPpj5AAJi1GH9584705.jpg)
本文出自 “jerry在路上” 博客,请务必保留此出处http://jerry0117.blog.51cto.com/1664014/1665770
相关文章推荐
- linux kbuild module
- linux下杀死进程(kill)的N种方法
- linux下杀死进程(kill)的N种方法
- Linux下:POSIX内存对象映射+POSIX内存对象信号量
- 新手来到
- 不借助 Wine 和云服务:新项目能让 Linux 完整运行微软 Office 套件
- WPS Office:Linux 上的 Microsoft Office 的免费替代品
- Linux操作系统安装LAMP环境
- CentOS SSH公钥登录问题
- Linux学习笔记整理第1节 - IP地址设置
- CentOS下删除openJDK
- 利用linux的mtrace命令定位内存泄露(Memory Leak)
- 用git下载linux源码
- Linux的几种查找命令
- linux下vi编辑文件
- Centos学习笔记之grep命令
- 鸟哥的Linux私房菜
- Linux touch 命令
- CentOS修改22默认端口 SSH默认端口
- 《鸟哥的Linux私房菜》第三章 主机规划与磁盘分区