freebsd7.0安裝cacti手冊

科技小先鋒發表於2017-11-14
[背景]公司的監控平臺大部分都是freebsd,為了以後安裝方便寫了個這個手冊,供以後用.
[內容]

注意:在安裝apache後,就開一個測試頁,裝了php,就一直用phpinfo來檢測改變!  記住要用apachectl graceful
(1)安裝apache

cd /usr/ports/www/apache22

make config

選擇mysql

make install clean

ee rc.conf

apache22_enable=”YES”
(2)安裝php

cd /usr/ports/lang/php5

make config

選擇apache

make install clean

修改httpd.conf

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps
cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini
(3)安裝mysql

cd /usr/ports/database/mysql50-server

make install clean

/usr/local/bin/mysql_install_db –user=mysql

/usr/local/bin/mysqld_safe –user=mysql&

ee rc.conf

mysql_enable=”YES”
(4)安裝php-extensions

cd /usr/ports/lang/php5-extensions

make config

選擇mysql

make install clean

[測試php連線mysql]

db.inc

<?php

$host=”localhost”;

$user=”root”;

$pwd=”badboy”;

?>

index.php

<?php

require_once “db.inc”;

$db=mysql_pconnect($host,$user,$pwd);

if ($db){

echo “connect!”;

}

?>
(5)安裝zend

cd /usr/local/devel/ZendOptimizer

make install clean

add

[Zend]

zend_optimizer.optimization_level=15

zend_extension_manager.optimizer=”/usr/local/lib/php/20060613/Optimizer”

zend_extension_manager.optimizer_ts=”/usr/local/lib/php/20060613/Optimizer_TS”

zend_extension=”/usr/local/lib/php/20060613/ZendExtensionManager.so”

zend_extension_ts=”/usr/local/lib/php/20060613/ZendExtensionManager_TS.so”
[注意]

上面的路徑中”20060613″這個是變數,不是固定的.
解決一個[問題]

Failed loading /usr/local/lib/php/20060613/ZendExtensionManager.so:  Shared object “libm.so.4” not found, required by “ZendExtensionManager.so”

報錯

解決辦法:ln -s /lib/libm.so.5 /usr/lib/libm.so.4即可。
(6)安裝rrdtool

cd /usr/ports/database/rrdtool

make install clean

(7)安裝net-snmp

cd /usr/ports/net-mgmt/net-snmp

make install clean

自動的會將snmp support加入到php的擴充套件功能中,所以在php擴充套件模組選擇上面沒有選擇snmp

ee /etc/snmpd.conf

###################################################################

# First, map the community name (COMMUNITY) into a security name

# (local and mynetwork, depending on where the request is coming

# from):
#       sec.name  source          community

com2sec notConfigUser  default  passwd


####

# Second, map the security names into group names:
#               sec.model  sec.name

group   notConfigGroup v1           notConfigUser
group   notConfigGroup   v2c           notConfigUser
####

# Third, create a view for us to let the groups have rights to:
#           incl/excl subtree                          mask

view all    included  .1                               80
####

# Finally, grant the 2 groups access to the 1 view with different

# write permissions:
#                context sec.model sec.level match  read   write  notif

access notConfigGroup “”      any       noauth    exact  all    none   none
#############################################################################
(8)安裝cacti

cd /usr/ports/net-mgmt/cacti

make config

選擇擴充套件外掛

make install clean


[注意]

每一款軟體安裝最後,都會有相應的提示,如snmp安裝後,cacti安裝後……有些可能是配置說明文件
本文轉自hahazhu0634 51CTO部落格,原文連結:http://blog.51cto.com/5ydycm/113305,如需轉載請自行聯絡原作者


相關文章