有了上次 proxy 被外人使用後
只能怪自己沒做好監控工作, 才會這麼晚才發現問題
所以要安裝一個 proxy 的監看軟體才行
http://sarg.sourceforge.net/sarg.php
download
http://nchc.dl.sourceforge.net/sourceforge/sarg/sarg-2.2.3.1.tar.gz
REF:
http://cha.homeip.net/blog/archives/2005/06/linux_nat_squid.html
REF: 即時性 proxy 監控
http://cha.homeip.net/blog/archives/2005/12/_squid_logfile.html
tar zxvf sarg-2.2.3.1.tar.gz
cd sarg-2.2.3.1
./configure
如果相依性沒有問題, 就會製作出適合的 make file
然後再去 make; make install
creating /usr/local/sarg
Creating /usr/local/sarg/languages
Creating /usr/local/sarg/fonts
cp sarg /usr/bin/sarg
chmod 755 /usr/bin/sarg
cp sarg.1 /usr/local/man/man1/sarg.1
chmod 755 /usr/local/man/man1/sarg.1
cp /usr/local/sarg/sarg.conf
cp -r ./languages /usr/local/sarg;
cp ./exclude_codes /usr/local/sarg;
cp ./user_limit_block /usr/local/sarg;
cp -r ./images /usr/local/sarg;
cp -r ./sarg-php /usr/local/sarg;
cp -r ./fonts /usr/local/sarg;
cp -r ./css.tpl /usr/local/sarg;
mkdir -p /home/httpd/sites/sarg
vi /usr/local/sarg/sarg.conf
建立 cron 檔案
vi /etc/cron.hourly/sarg
建立 httpd 檔案
vi /etc/httpd/conf.d/httpd-sarg.php
---
Alias /mrtg "/home/httpd/sites/sarg/"
AddOutputFilter INCLUDES .html
Options Includes Indexes MultiViews
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.1 192.168.0.0/255.255.0.0
Allow from ::1
# Allow from .example.com
---
有時候執行 sarg 時, 會出現 segmentation fault
那就有可能是 squid 的 log 檔有些資訊沒法被正確讀取
可以利用 sarg -m 的方式, 查看是在哪個資料被讀取時,
會出現 segmentation fault 的訊息, 再去砍掉它或移掉它就OK了
也有時候出現 某某日期 不能被寫入
就要注意是不是該磁區的空間不足了。
df -h 一下吧
中文檔
wget http://blog.ilc.edu.tw/blog/blog/1168/resource/6306/download/47894
或到 Vbird 的站可下載得到, 再存放到 /usr/local/sarg/languages/ 目錄下, 檔案自己取
|