三、稍微修改Bandwidthd配置文件即可
vi /etc/bandwidthd/bandwidthd.conf
/etc/init.d/bandwidthd restart #重启bandwidthd服务
启动后2~3分钟,用pgadmin工具看看数据库,就可以可能到数据了。

四、配置php页面
vi /etc/bandwidthd/debian-db.php
例如:
$dbuser='bandwidthdpgsql';
$dbpass='123456';
$basepath='';
$dbname='bandwidthdpgsql';
$dbserver='localhost';
$dbport='5432';
$dbtype='pgsql';
将Bandwidthd的php站点添加到apache里面
vi /etc/apache2/conf.d/bandwidthd
Alias /bandwidthd /var/lib/bandwidthd/htdocs
<Directory /var/lib/bandwidthd/htdocs>
DirectoryIndex index.php
AllowOverride None
order deny,allow
deny from all
#allow from 127.0.0.0/255.0.0.0 ::1/128
allow from all
<IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_value include_path .
</IfModule>
<IfModule !mod_php5.c>
<IfModule mod_actions.c>
<IfModule mod_cgi.c>
AddType application/x-httpd-php .php
Action application/x-httpd-php /cgi-bin/php
</IfModule>
<IfModule mod_cgid.c>
AddType application/x-httpd-php .php
Action application/x-httpd-php /cgi-bin/php
</IfModule>
</IfModule>
</IfModule>
</Directory>
敲入上面的配置信息,当然,你可以用 phppgadmin的配置文件作为范本,cp一个出来修改哈即可。
这2步完成后,重启apache即可
/etc/init.d/apache2 restart

打开浏览器,选择你的传感器后,你就可以看到流量信息了。。。。
例如:http://192.168.1.4/bandwidthd/sensors.php

五、如果有不清楚的地方,用 man bandwidthd 看看
FILES
/usr/sbin/bandwidthd - daemon binary.
/etc/init.d/bandwidthd - startscript.
/etc/bandwidthd/bandwidthd.conf - configuration file.
/var/run/bandwidthd.pid - main process id file.
/var/lib/bandwidthd/ - log directory.
/var/lib/bandwidtd/htdocs/ - html and graphs output directory.
六、如果还有不明白的地方,推荐你看看下面的资料
(1) Ubuntu 12.04环境下配置Postgresql和phppgadmin http://www.linuxidc.com/Linux/2013-11/92933.htm
(2)Bandwidthd完整实战笔记 http://www.linuxidc.com/Linux/2013-11/92934.htm
