Bandwidthd+Postgresql数据库配置笔记
来源:互联网 发布:淘宝上怎么找卖片的 编辑:程序博客网 时间:2024/06/05 00:08
Bandwidthd+Postgresql数据库配置笔记
本系列文章由ex_net(张建波)编写,转载请注明出处。
http://blog.csdn.net/zjianbo/article/details/16717625
作者:张建波 邮箱: 281451020@qq.com 电话:13577062679 欢迎来电交流!
一、安装前的准备工作
(1)安装前请参考http://blog.csdn.net/zjianbo/article/details/16623879,了解Postgresql数据库的安装配置。
(2)创建 bandwidthd-pgsql 账号,该账户用来让Bandwidthd登录Postgresql数据库的
root@ubuntu:~# su - postgrespostgres@ubuntu:~$ psqlpsql (9.1.9)Type "help" for help.postgres=# CREATE USER bandwidthdpgsql;CREATE ROLEpostgres=# ALTER USER bandwidthdpgsql PASSWORD '123456';ALTER ROLEpostgres=# \qpostgres@ubuntu:~$ exitlogoutroot@ubuntu:~#
(3)创建数据库
create database bandwidthdpgsql;
和第(2)步一样,还是用 su - postgres登录后执行
说明:
在Ubuntu下,不需要用 schema.postgresql 这个脚本创建表了。这一点和用源码安装方式有点不一样,可能是Ubuntu实在是考虑的比较周全把。
二、安装Bandwidthd软件包
apt-get install bandwidthd-pgsql
三、稍微修改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';
vi /etc/apache2/conf.d/bandwidthd
Alias /bandwidthd /var/lib/bandwidthd/htdocs<Directory /var/lib/bandwidthd/htdocs>DirectoryIndex index.phpAllowOverride Noneorder deny,allowdeny from all#allow from 127.0.0.0/255.0.0.0 ::1/128allow 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://blog.csdn.net/zjianbo/article/details/16623879
(2)Bandwidthd完整实战笔记_1 http://blog.csdn.net/zjianbo/article/details/15026111
- Bandwidthd+Postgresql数据库配置笔记
- Bandwidthd完整实战笔记(Postgresql)_2
- bandwidthd的安装配置
- Bandwidthd完整实战笔记_1
- PostgreSQL数据库服务器配置
- PostgreSQL 数据库访问配置
- POSTGRESQL 数据库 服务配置
- PostgreSQL数据库基本配置
- 【centos】配置postgresql数据库。
- postgresql 数据库操作笔记
- postgreSQL数据库中postgresql.conf配置
- CodeIgniter数据库PostgreSQL配置要点
- PostgreSQL数据库远程连接配置
- PostgreSQL远程访问数据库 配置
- PostgreSql 数据库的访问权限配置
- linux的数据库篇- PostgreSQL安装配置
- 在LiftWeb下配置PostgreSQL数据库
- PostgreSQL数据库的安装与配置
- Low Memory Killer
- OpenCV实现的高斯滤波探究_1(《学习OpenCV》练习题第五章第三题ab部分)
- Windows中如何删除一个目录下所有的.svn目录
- linux crontab执行shell脚本中包含相对路径的问题
- Google C++编程规范:(三)类
- Bandwidthd+Postgresql数据库配置笔记
- Java Design Pattern: State
- WebService第二步 - 按规定的标准开发
- java数字保留2位小数
- ios7 UIAnimation
- openSSL使用手册
- JBMP中文乱码问题的解决方案
- 解决linux安装JDK时Error occurred during initialization of VM
- GNU汇编器 编写汇编函数 [李园7舍_404]