手机版
你好,游客 登录 注册
背景:
阅读新闻

Bandwidthd+PostgreSQL数据库配置笔记

[日期:2013-11-19] 来源:CSDN  作者:ex_net(张建波) [字体:大 中 小]

三、稍微修改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

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款