1. # apt-get install libpcap libgd libpng [enter]
2. # dpkg --install SARGE-bandwidthd_2.0.1_i386.deb [enter]
3. # cd /etc/bandwidthd
4. # vi bandwidthd.conf [enter]
------>  設定 subnet  192.168.1.0/24
                      subnet 192.168.2.0 255.255.255.0
(依照自己的網段設定要偵測的範圍!)

                      dev "eth0" (可下 bandwidthd -l 指令查詢)
                      dev "any" (若有二個不同網段要偵測時, 可使用 any參數)

5. # /etc/init.d/bandwidthd start [enter] (設定檔設定完存檔後, 啓動程式)
6. # ps aux | grep bandwidthd [enter] (查看服務是否有啓動)
7. # ln -s /var/lib/bandwidthd/htdocs /var/www/bandwidthd [enter]
8. 開網頁驗證: http://IP/bandwidthd [enter] (等約三分鐘後, 若能看到網頁顯示圖表, 就表示設定正確!)

 

 

 

# Please run "su" into root enviroment

echo -e "\033[31m"
echo -e "\Program : bandwidthd_debian40r3_apt_small.sh "
echo -e " BandWidthD 2.0.1 Install Shell Script (Debian 4.0r3) "
echo -e " by lu 2008/04/23 "
echo -e "\033[0m"

apt-get -y install  apache2  bandwidthd

echo "Alias /bandwidthd /var/lib/bandwidthd/htdocs"  >  /etc/apache2/conf.d/bandwidthd.conf
echo "<Location>"  >>  /etc/apache2/conf.d/bandwidthd.conf
echo "    Order deny,allow"  >>  /etc/apache2/conf.d/bandwidthd.conf
echo "#    Deny from all"  >>  /etc/apache2/conf.d/bandwidthd.conf
echo "    Allow from 127.0.0.1"  >>  /etc/apache2/conf.d/bandwidthd.conf
echo "    Allow from ::1"  >>  /etc/apache2/conf.d/bandwidthd.conf
echo "    # Allow from .example.com"  >>  /etc/apache2/conf.d/bandwidthd.conf
echo "</Location>"  >>  /etc/apache2/conf.d/bandwidthd.conf

/etc/init.d/bandwidthd  restart
#ps aux | grep bandwidthd

/etc/init.d/apache2 restart
#chkconfig httpd on
#ps aux | grep apache2

firefox http://localhost/bandwidthd &

文章標籤
全站熱搜
創作者介紹
創作者 ........... 的頭像
...........

..........

........... 發表在 痞客邦 留言(0) 人氣(29)