squid管理工具sarg安装,配置,使用
sarg是以網頁的形勢來展示squid緩存結果的一種工具
wgethttp://www.sfr-fresh.com/unix/privat/sarg-2.2.7.1.tar.gz
一,安裝
tar zxvf /home/zhangy/download/sarg-2.2.7.1.tar.gz -C /home/zhangy cd /home/zhangy/sarg-2.2.7.1 ./configure --prefix=/usr/local/sarg make && make install
二,配置
cd /usr/local/sarg/etc
下面有一個sarg.conf文件,這個文件是配置大全,不過全被注釋掉了。所以這個文件我不需要,當作備份。
mv sarg.conf sarg.confbak
vi sarg.conf
把下面的內容考進去,是我機子里面的sarg配置
1 language English #英文版
2 access_log /usr/local/squid/var/logs/access.log #squid安裝時,access_log的所在
3 font_face Verdana,Arial #字體設置,因為這個管理工具是網頁的形勢存在的
4 header_color darkblue #設header的顏色
5 font_size 12px #設置字體大小
6 password none #不要設密碼
7 title "Squid report" #設置標題
8 output_dir /home/zhangy/www/sarg #生成后的html存放到那里,設置到你的網站目錄下,/home/zhangy/www是網站的根目錄
9 overwrite_report yes #是否覆蓋報告,當那個日期的報告已經存在時是否覆蓋掉
10 mail_utility mail #以mail方式來發郵件
11 exclude_hosts /usr/local/sarg/etc/exclude_hosts #不充許的hosts
12 topsites_num 100 #最多可以顯示多少個網站
13 exclude_codes /usr/local/sarg/etc/exclude_codes
14 max_elapsed 28800000 #設置過時時間
15 charset utf8 #設置編碼
三,測試
配置好了以后
[root@BlackGhost bin]#./sarg
SARG: Records in file: 120, reading: 100.00%
SARG: Successful report generated on /home/zhangy/www/sarg/2010Jun13-2010Jun13
有了這個則表示,sarg才真正的安裝配置好了。
參數如下
./sarg -h
./sarg: usage [options...]
-a hostname or ip address 指定不計入排序的主機名稱或地址
-b useragent log 用戶代理日志文件輸出
-c exclude file 指定不計入排序的站點列表文件名為/usr/local/sarg/norecords,對于客戶端訪問的這些站點,將不會被top排序中
-d date from-until dd/mm/yyyy-dd/mm/yyyy 指定日期范圍
-e email address to send reports (stdout for console) 指定報告接收者郵件
-f config file (/usr/local/sarg/sarg.conf) 指定配置文件
-g date format [e=europe -> dd/mm/yy, u=usa -> mm/dd/yy] 指定輸入的日期格式
-h help (this…) 列幫助信息
-i reports by user and ip address 指定客戶端排序采用用戶名或者ip地址
-l input log 指定squid日志文件絕對路徑。
-o output dir 指定網頁報告文件輸出路徑,推薦使用webmaster或其他非admin用戶運行sarg。
-p use ip address instead userid (reports) 使用ip地址作為userid域
-w temporary dir 指定臨時文件目錄,請確認該目錄所在的分區足夠大先,1g以上。
http://localhost/sarg/2010Jun13-2010Jun13/127.0.0.1/127.0.0.1.html內容如下
squid緩存報告
squid安裝配置的博文http://blog.51yip.com/server/638.html,本文sarg所報告的就是638這篇博文里所安裝squid所產生的數據。
總結
以上是生活随笔為你收集整理的squid管理工具sarg安装,配置,使用的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 科创板打新深市市值算吗?
- 下一篇: python的数据类型及格式化输出
