Cacti的安装配置-相关扩展设置
创始人
2024-07-25 03:50:33
0

  Cacti 安装配置:回大纲

  PHP扩展设置

  Cacti 使用如下 PHP 扩展组件:mysql、session、sockets、xml、pcre,同时,我们也建议使用snmp扩展。你可以选择使用 net-snmp 来代替 php-snmp 扩展(有时是 net-snmp-utils )。

  Cacti 插件会使用额外的扩展,比如gd (reportit 使用)、dom (cli 脚本使用,只在 PHP 5 中才被支持)

  当使用一个较新版本的 PHP 时,你可能会发现的提示

  1.   ;;;;; Note: packaged extension modules are now loaded via the .ini files; found in the directory /etc/php.d; these are loaded by default.;;;;  
  2.  

  这种情况下,并没有什么特殊的地方。不过需要验证下扩展模块相关 的ini配置文件是否已经配置在php支持的目录下。

  对于较老版本版本的PHP,你需要编辑 php.ini 并且增加

  1.   extension_dir = /etc/php.d  
  2.  

  这将支持 PHP 在配置的目录下寻找更多的扩展配置文件。对不同的 Linux 分支而言,扩展文件夹的路径可能并不相同,比如会在 extension_dir=/usr/lib/php/modules。

  编辑 /mysql.ini 以激活 mysql 扩展。

  1.   ; Enable mysql extension moduleextension=mysql.so  
  2.  

  编辑 /snmp.ini 以激活 snmp 扩展。

  1.   ; Enable snmp extension moduleextension=snmp.so  
  2.  

  如果使用 PHP 4.3.5 以下的版本,那么在 php.ini 中添加以下配置;如果使用 PHP 4.3.6 之上的版本,那么请在配置文件中移除此行(如果存在的话)。

  1.   session.save_path=/tmp  
  2.  

  配置网络服务器(Apache)

  如果你还在使用 Apaceh 1.3.x 版,那么安装使用 PHP 5.x 或许并不合适。

  请查找文件类似 "/etc/httpd/conf/httpd.conf" 的文件,并且确认文件中包含

  1.   # Load config files from the config directory "/etc/httpd/conf.d". Include conf.d/*.conf  
  2.  

  现在,请编辑其中的包含的PHP配置文件 "/etc/httpd/conf.d/php.conf",如果是使用 PHP 5,那么,确认文件中包含:

  1.   # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. LoadModule php5_module modules/libphp5.so # # Cause the PHP interpreter to handle files with a .php extension. AddHandler php5-script .php AddType text/html .php # # Add index.php to the list of files that will be served as directory # indexes. DirectoryIndex index.php  
  2.  

  如果你不是安装 Cacti 到 Apache 默认的网络目录文件夹位置,那么在 /etc/httpd/conf.d 中新增配置文件 cacti.conf,并且按如下内容编辑。设置 /your/cacti/dir 为你自己的cacti目录名称。更新 Allow from 127.0.0.1 为任何你需要的的配置(比如,你所在公司的某个子网段)。请留意注释中的配置提示,尤其是在你启用了 SELinux 的时候!

  1.   # Cacti - the complete rrdtool-based graphing solution# # Allows only localhost by default## Allowing cacti to anyone other than localhost should be considered# dangerous unless properly secured by SSL# Make sure, that httpd can read your cacti directories.# At minimum, you need# chmod ugo+r -R /your/cacti/dir# Make sure to replace with your directories# When using SELinux, set the following:# chcon -R -h -t httpd_sys_content_t /your/cacti/dir# when using SELinux and you private homedir, enable# setsebool -P httpd_enable_homedirs 1# setsebool -P httpd_read_user_content 1Alias /cacti /your/cacti/dir AllowOverride None Order Deny,Allow Deny from all Allow from 127.0.0.1 Allow from ::1 Options Indexes Includes FollowSymLinks# These directories do not require access over HTTP # Order Deny,Allow Deny from All Allow from None  
  2.  

  MySQL设置

  为 MySQL 的 root 用户设置一个密码。

  1.   shell> mysqladmin --user=root password somepassword shell> mysqladmin --user=root --password reload  
  2.  

  请参阅MySQL的文档以了解详细内容。

  1.   UCD-SNMP-MIB::versionConfigureOptions.0 = STRING: "'-disable-shared'  
  2.  
  3.   '--with-mib-modules=host/hr_system'"  
  4.  

【编辑推荐】

Cacti安装篇

Cacti配置下的使用技巧

Cacti如何监控Tomcat

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
Windows恶意软件20年“... 在Windows的早期年代,病毒游走于系统之间,偶尔删除文件(但被删除的文件几乎都是可恢复的),并弹...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...