- 论坛徽章:
- 0
|
作者:梅劲松
本文档为MIT授权.
需要更新流量监控,刚好听说Cacti 不错。于是ports安装一下。
我的是5.x的freebsd系统。
1、cd /usr/share/examples/cvsup
2、 cvsup -g -L 2 ports-supfile
3、cd /usr/ports/www/apache22下make;make install
4、 cd /usr/ports/lang/php4下make;make install
5、编辑httpd.conf加入如下代码
###############for php and cacti###################
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType image/x-icon .ico
DirectoryIndex index.php index.html index.html.var
#######################over########################
6、如果你想使用mysql5 那么请先到mysql50-server或者mysql51-server下make;make install
7、如果想使用mysql,请直接到 /usr/ports/net/cacti下make;make install
8、
# mysql -u root -prootroot
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>; create database cactidb;
Query OK, 1 row affected (0.00 sec)
mysql>; grant all on cactidb.* to root;
Query OK, 0 rows affected (0.01 sec)
mysql>; grant all on cactidb.* to root@localhost;
Query OK, 0 rows affected (0.01 sec)
mysql>; grant all on cactidb.* to cactiuser;
Query OK, 0 rows affected (0.00 sec)
mysql>; grant all on cactidb.* to cacti@localhost;
Query OK, 0 rows affected (0.01 sec)
mysql>; set password for cacti@localhost=password('cactipw');
Query OK, 0 rows affected (0.00 sec)
mysql>; exit
9、使用cacti.sql来建库
/usr/local/mysql/bin/mysql –u root –prootroot cactidb < cacti.sql
10、注意!!是修改db-settings.php文件里面的数据库信息。
11、
Crontab –u cactiuser –e
为cacti用户加入
*/5 * * * * /www/php/bin/php /www/htdocs/cacti/poller.php > /dev/null 2>&1
12、配置好你的访问地址或者虚拟主机。
13、重新启动,等待5分钟以上。ok!
[ 本帖最后由 xichen 于 2006-2-22 17:00 编辑 ] |
|