Cacti的安裝配置-相關(guān)擴展設(shè)置
Cacti 安裝配置:回大綱
PHP擴展設(shè)置
Cacti 使用如下 PHP 擴展組件:mysql、session、sockets、xml、pcre,同時,我們也建議使用snmp擴展。你可以選擇使用 net-snmp 來代替 php-snmp 擴展(有時是 net-snmp-utils )。
Cacti 插件會使用額外的擴展,比如gd (reportit 使用)、dom (cli 腳本使用,只在 PHP 5 中才被支持)
當(dāng)使用一個較新版本的 PHP 時,你可能會發(fā)現(xiàn)的提示
- ;;;;; Note: packaged extension modules are now loaded via the .ini files; found in the directory /etc/php.d; these are loaded by default.;;;;
這種情況下,并沒有什么特殊的地方。不過需要驗證下擴展模塊相關(guān) 的ini配置文件是否已經(jīng)配置在php支持的目錄下。
對于較老版本版本的PHP,你需要編輯 php.ini 并且增加
- extension_dir = /etc/php.d
這將支持 PHP 在配置的目錄下尋找更多的擴展配置文件。對不同的 Linux 分支而言,擴展文件夾的路徑可能并不相同,比如會在 extension_dir=/usr/lib/php/modules。
編輯 /mysql.ini 以激活 mysql 擴展。
- ; Enable mysql extension moduleextension=mysql.so
編輯 /snmp.ini 以激活 snmp 擴展。
- ; Enable snmp extension moduleextension=snmp.so
如果使用 PHP 4.3.5 以下的版本,那么在 php.ini 中添加以下配置;如果使用 PHP 4.3.6 之上的版本,那么請在配置文件中移除此行(如果存在的話)。
- session.save_path=/tmp
配置網(wǎng)絡(luò)服務(wù)器(Apache)
如果你還在使用 Apaceh 1.3.x 版,那么安裝使用 PHP 5.x 或許并不合適。
請查找文件類似 "/etc/httpd/conf/httpd.conf" 的文件,并且確認(rèn)文件中包含
- # Load config files from the config directory "/etc/httpd/conf.d". Include conf.d/*.conf
現(xiàn)在,請編輯其中的包含的PHP配置文件 "/etc/httpd/conf.d/php.conf",如果是使用 PHP 5,那么,確認(rèn)文件中包含:
- # 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
如果你不是安裝 Cacti 到 Apache 默認(rèn)的網(wǎng)絡(luò)目錄文件夾位置,那么在 /etc/httpd/conf.d 中新增配置文件 cacti.conf,并且按如下內(nèi)容編輯。設(shè)置 /your/cacti/dir 為你自己的cacti目錄名稱。更新 Allow from 127.0.0.1 為任何你需要的的配置(比如,你所在公司的某個子網(wǎng)段)。請留意注釋中的配置提示,尤其是在你啟用了 SELinux 的時候!
- # 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
MySQL設(shè)置
為 MySQL 的 root 用戶設(shè)置一個密碼。
- shell> mysqladmin --user=root password somepassword shell> mysqladmin --user=root --password reload
請參閱MySQL的文檔以了解詳細內(nèi)容。
- UCD-SNMP-MIB::versionConfigureOptions.0 = STRING: "'-disable-shared'
- '--with-mib-modules=host/hr_system'"
【編輯推薦】