Linux 流量控管不想要架設 SNMP 的話, 可以考慮使用 iptotal.
iptotal 簡介
- iptotal - monitor for IP traffic, not requiring SNMP
- 官網: iptotal - Freecode
iptotal 安裝設定
- sudo apt-get install iptotal
- sudo /etc/init.d/iptotal restart
- # 設定 Web 瀏覽, 在此採用 VirtualHost 設定
- sudo cp /etc/iptotal/apache.conf /etc/apache2/sites-enabled/iptotal
- sudo vim /etc/apache2/sites-enabled/iptotal
<VirtualHost *:80> #Alias /iptotal /var/lib/iptotal/ ServerName traffic.example.com DocumentRoot /var/lib/iptotal/ <Directory /var/lib/iptotal> Options +FollowSymLinks AllowOverride None order allow,deny allow from all DirectoryIndex template.html </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> # 若想要鎖密碼的話, iptotal.passwd 請自行用 htpasswd 建立 <LocationMatch "/"> AuthType Basic AuthName "Iptotal Traffic" AuthUserFile /etc/apache2/iptotal.passwd Require valid-user </LocationMatch> </VirtualHost>
- cd /var/lib/iptotal/
- sudo mkdir iptotal
- cd iptotal/
- sudo ln -s ../archive/ . # 修正資料路徑
- sudo ln -s ../images/ . # 修正圖片路徑
- sudo /etc/init.d/apache2 restart # 到此即完成.
iptotal 管理
- 流量控管可見: http://traffic.example.com
- 網頁版面修改可改此檔案: /var/lib/iptotal/template.html # /usr/share/iptotal/www/template.html