设为首页 收藏本站
查看: 1266|回复: 0

[经验分享] 个非常完整的Cacti安装手册(RedHat AS 4)--使用cacti监控你的网络

[复制链接]
YunVN网友  发表于 2019-1-12 08:23:28 |阅读模式
  一、Cacti的安装
  1.安装环境:RedHat AS 4
  2.安装Apache、MySQL、PHP
  (1).安装MySQL
  下载地址:http://dev.mysql.com/downloads/mysql/5.0.html
  //查看系统中是否已经安装了MySQL,如果是卸载所有以mysql开头的包。
  # rpm –qa | grep mysql
  # rpm –e mysql-*
  //查找/etc/my.cnf(MySQL的选项配置文件),如果有请删除它,以免影响新安装版本的启动。
  # rm –f /etc/my.cnf
  # tar –zxvf mysql-standard-5.0.27-linux-i686-glibc23.tar.gz
  # cp –rf mysql-standard-5.0.27-linux-i686-glibc23 /usr/local/
  //建立符号链接,如果以后有新版本的MySQL的话,你可以仅仅将源码解压到新的路径,然后重新做一个符号链接就可以了。这样非常方便,数据也更加安全。
  # ln –s mysql-standard-5.0.27-linux-i686-glibc23 /usr/local/mysql
  //添加用于启动MySQL的用户及用户组(如果以前安装过MySQl,用户及用户组可能已存在)。
  # useradd mysql
  # groupadd mysql
  //修改MySQl目录的所有权
  # cd /usr/local
  # chgrp –R mysql mysql-standard-5.0.27-linux-i686-glibc23
  # chgrp –R mysql
  # chown –R mysql mysql-standard-5.0.27-linux-i686-glibc23/data
  # chown –R mysql mysql/data
  //初始化授权表
  # cd /usr/local/mysql
  # scripts/mysql_install_db
  # ln –s /usr/local/mysql/bin/* /usr/local/bin/
  //启动Mysql
  # bin/safe_mysqld --user=mysql &
  //配置系统启动时自动启动MySQl
  # cp support-files/mysql.server /etc/rc.d/init.d/mysqld
  # chkconfig --add mysqld
  (2).安装Apache
  下载地址:http://httpd.apache.org/
  # tar –zxvf httpd-2.2.4.tar.gz
  # cd httpd-2.2.4
  # ./configure --prefix=/usr/local/apache --enable-so
  //编译时加上加载模块参数--enable-so
  # make
  # make install
  #vi /usr/local/apache/conf/httpd.conf
  //修改Apache配置文件,添加ServerName www.yourdomain.com              (或ServerName 本机ip)
  # vi /etc/rc.d/rc.local
  //在rc.local上加入一行/usr/local/apache/bin/apachectl –k start,系统启动时启动Apache服务。
  (3).安装PHP
  先安装zlib,freetype,libpng,jpeg以便于让PHP支持GD库(Cacti的WeatherMap插件必须要较新GD库的支持)
  库文件下载地址:http://oss.oetiker.ch/rrdtool/pub/libs/
  1).安装zlib
  tar zlib-1.2.3.tar.gz
  cd zlib-1.2.3
  ./configure --prefix=/usr/local/zlib
  make
  make install
  2).安装libpng
  tar zxvf libpng-1.2.16.tar.tar
  cd libpng-1.2.16
  cd scripts/
  mv makefile.linux ../makefile
  cd ..
  make
  make install
  注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个
  3).安装freetype
  tar zxvf freetype-2.3.4 .tar.gz
  cd freetype-2.3.4
  ./configure --prefix=/usr/local/freetype
  make
  make install
  4).安装Jpeg
  tar -zxf jpegsrc-1.v6b.tar.gz
  cd jpeg-6b/
  mkdir /usr/local/libjpeg
  mkdir /usr/local/libjpeg/include
  mkdir /usr/local/libjpeg/bin
  mkdir /usr/local/libjpeg/lib
  mkdir /usr/local/libjpeg/man
  mkdir /usr/local/libjpeg/man/man1
  //可以用mkdir -p /usr/local/libjpeg/man/man1 一步创建多层目录
  ./configure --prefix=/usr/local/libjpeg --enable-shared --enable-static
  make && make install
  注意,这里configure一定要带--enable-shared参数,不然,不会生成共享库
  5).安装Fontconfig
  tar -zxvf fontconfig-2.4.2.tar.gz
  cd fontconfig-2.4.2
  make
  make install
  6).安装GD
  tar -zxvf gd-2.0.34.tar.gz
  cd gd-2.0.34
  ./configure --with-png --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/libjpeg
  make
  make install
  编译时显示以下信息:
  ** Configuration summary for gd 2.0.34:
  Support for PNG library:          yes
  Support for JPEG library:         yes
  Support for Freetype 2.x library: yes
  Support for Fontconfig library:   yes
  Support for Xpm library:          no
  Support for pthreads:             yes
  7).安装libxml,RedHat AS 4默认安装libxml包,但版本太低,PHP5需要更高版本的libxml包。
  # tar –zxvf libxml2-2.6.25.tar.gz
  # cd libxml2-2.6.25
  # ./configure
  # make
  # make install
  8).安装PHP
  PHP下载地址:http://www.php.net/downloads.php#v5
  tar -zxvf  php-5.2.3.tar.gz
  cd php-5.2.3
  # ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/usr/local/libgd --enable-gd-native-ttf --with-ttf --enable-gd-jis-conv --with-freetype-dir=/usr/local/freetype –with-mail --with-jpeg-dir=/usr/local/libjpeg --with-png --with-zlib-dir=/usr/local/zlib --enable-xml --enable-mbstring --enable-sockets
  # make
  # make install
  # ln –s /usr/local/php/bin/* /usr/local/bin/
  # vi /usr/local/apache/conf/httpd.conf
  查找AddType application/x-compress .Z
  AddType application/x-gzip .gz .tgz
  在其下加入 AddType application/x-tar .tgz
  AddType application/x-httpd-php .php
  AddType image/x-icon .ico
  修改DirectoryIndex 行,添加index.php
  修改为DirectoryIndex index.php index.html index.html.var
  # vi /usr/local/apache/htdocs/test.php
  添加以下行:
  //php标记(用 /dev/null 2>&1
  4.安装Cactid
  CACTID 的安装需要以下支持:
  o    net-snmp-devel (需要编译安装net-snmp时添加--enable-developer选项)
  o    mysql
  o    mysql-devel     (mysql源文件编译安装后默认支持)
  o    openssl-devel  (Redhat默认安装)
  # tar -zxvf cacti-cactid-0.8.6i.tar.gz
  # cd cacti-cactid-0.8.6i
  # ./configure --with-mysql=/usr/local/mysql --with-snmp=/usr/local/net-snmp
  # make
  //这时你将在此目录下看到多出了cactid、cactid.conf两个文件
  # mkdir /usr/local/cactid
  # cp cactid cactid.conf /usr/local/cactid
  # vi  /usr/local/cactid/cactid.conf       //修改cactid配置文件
  DB_Host         127.0.0.1
  DB_Database     cacti
  DB_User         cacti
  DB_Pass         cacti
  5.数据库配置
  #mysql –uroot –p
  Password:
  mysql> create database cacti;
  Query OK, 1 row affected (0.00 sec)


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-662214-1-1.html 上篇帖子: Cacti 显示自定义的 SNMP 数据 下篇帖子: Cacti的安装【转】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表