使用者透過 Proxy 無法做 SVN Commit
出現下面訊息
Commit
Commit failed (details follow):
Server sent unexpected return value (400 Bad Request) in response to MKACTIVITY
request for '/svn/mstar/!svn/act/6c6b0d3e-111a-5f4e-bd9a-f24d71d4de02'
解法:
很簡單, 只是 Squid 看不懂 request method
vi /etc/squid/squid.conf
extension_methods REPORT MERGE MKACTIVITY CHECKOUT PROPFIND
Showing posts with label squid. Show all posts
Showing posts with label squid. Show all posts
Wednesday, March 03, 2010
Wednesday, January 06, 2010
Squid 除錯 - storeSwapOutFileClosed: dirno 1, swapfile 000XXXX, errflag=FFFFFFFF
在 Squid cache.log 看到這個 log 乍看之下以為是 檔案壞掉
2009/12/31 12:44:35| storeSwapOutFileClosed: dirno 1, swapfile 0006DAFB, errflag=FFFFFFFF
經追查結果應該是檔案目錄結構壞掉,無法寫入所致。
把 cache 目錄重新 format 一次再重新建 cache 目錄即可。
2009/12/31 12:44:35| storeSwapOutFileClosed: dirno 1, swapfile 0006DAFB, errflag=FFFFFFFF
經追查結果應該是檔案目錄結構壞掉,無法寫入所致。
把 cache 目錄重新 format 一次再重新建 cache 目錄即可。
Monday, November 30, 2009
Squid 3.1 與 Ubuntu 9.10 - Compile Issue
若用 Ubuntu 9.10 由於 Kernel 已經用到 2.6.31
在 compile 要 squid-3.1.0.15 才不會有問題
用過 squid-3.1.0.8 , squid-3.1.0.13 都不行
0. 先安裝 compiler 相關工具 build-essential
我有用 ldap 所以也要安裝
apt-get install build-essential libssl-dev libldap2-dev
1. tar zxvf squid-3.1.0.15.tar.gz
cd squid-3.1.0.15
vi build.sh
./configure --prefix=/home/squid \
--mandir=/usr/local/man \
--enable-snmp \
--enable-htcp \
--enable-gnuregex \
--enable-dlmalloc \
--enable-referer-log \
--enable-async-io=160 \
--enable-useragent-log \
--enable-cache-digists \
--enable-cpu-profiling \
--enable-kill-parent-hack \
--enable-removal-policies \
--enable-xmalloc-statistics \
--enable-default-err-language=Traditional_Chinese \
--enable-basic-auth-helpers="LDAP" \
--enable-external-acl-helpers="ldap_group" \
--enable-storeio=diskd,ufs \
--with-filedescriptors=4096 \
--with-maxfd=16384 \
--enable-ssl
sh build.sh
make && make install
在 compile 要 squid-3.1.0.15 才不會有問題
用過 squid-3.1.0.8 , squid-3.1.0.13 都不行
0. 先安裝 compiler 相關工具 build-essential
我有用 ldap 所以也要安裝
apt-get install build-essential libssl-dev libldap2-dev
1. tar zxvf squid-3.1.0.15.tar.gz
cd squid-3.1.0.15
vi build.sh
./configure --prefix=/home/squid \
--mandir=/usr/local/man \
--enable-snmp \
--enable-htcp \
--enable-gnuregex \
--enable-dlmalloc \
--enable-referer-log \
--enable-async-io=160 \
--enable-useragent-log \
--enable-cache-digists \
--enable-cpu-profiling \
--enable-kill-parent-hack \
--enable-removal-policies \
--enable-xmalloc-statistics \
--enable-default-err-language=Traditional_Chinese \
--enable-basic-auth-helpers="LDAP" \
--enable-external-acl-helpers="ldap_group" \
--enable-storeio=diskd,ufs \
--with-filedescriptors=4096 \
--with-maxfd=16384 \
--enable-ssl
sh build.sh
make && make install
Wednesday, October 14, 2009
新版 msn 無法用 squid proxy 連線
新版 MSN 一推出,同事的 MSN 都被打掛不能使用。當天真的很慘, MIS 的電話幾乎被打爆。
昨天重新在 review fail log ,忽然找到原因了。
不能連線的原因是出在若使用者某一台電腦是第一次登入 MSN , MSN 會去取連絡人清單等資料,但由於 MSN 有 BUG,當他在用 SSL 連線取得連絡人清單時,並不會把 LDAP 的 帳號帶過去,所以連線被視為非法連線被 Proxy 拒絕掉。
現在只要讓這些網站的 SSL Connection 可以過, MSN 連線就會正常。
squid.conf example
### for new msn messenger
acl msn_ssl dstdomain .contacts.msn.com .storage.msn.com
http_access allow msn_ssl CONNECT
昨天重新在 review fail log ,忽然找到原因了。
不能連線的原因是出在若使用者某一台電腦是第一次登入 MSN , MSN 會去取連絡人清單等資料,但由於 MSN 有 BUG,當他在用 SSL 連線取得連絡人清單時,並不會把 LDAP 的 帳號帶過去,所以連線被視為非法連線被 Proxy 拒絕掉。
現在只要讓這些網站的 SSL Connection 可以過, MSN 連線就會正常。
squid.conf example
### for new msn messenger
acl msn_ssl dstdomain .contacts.msn.com .storage.msn.com
http_access allow msn_ssl CONNECT
Monday, May 12, 2008
Squid 語音封鎖
收集一些語音播放的網址
如果有需要在公司檔線上收聽音樂 可以參考
Video 播放暫時還沒有阻擋的計畫 故不在此篇範圍
用 Google 搜尋一下 關鍵字可以用 "src player .swf"
發現很多網站使用 ....player.swf
如果只檔 player.swf 是可以擋掉七八成以上
http://pic.wretch.cc/icon/mp3player.swf?config=http://l.yimg.com/wretch.yimg.com/icon/mp3player.xml
http://pic.wretch.cc/photos/serv/video/video_player/BGMusicPlayer.swf
http://l.yimg.com/wretch.yimg.com/photos/icon/WretchFLVPlayer.swf
http://l.yimg.com/wretch.yimg.com/photos/serv/video/video_player/WretchPlayer.swf
http://l.yimg.com/wretch.yimg.com/photos/serv/video/video_player/BGMusicPlayer.swf
http://vlog.xuite.net/vlog/guest/external.php?media_id=$1=&pt=0&ar=0&as=0"
如果有需要在公司檔線上收聽音樂 可以參考
Video 播放暫時還沒有阻擋的計畫 故不在此篇範圍
用 Google 搜尋一下 關鍵字可以用 "src player .swf"
發現很多網站使用 ....player.swf
如果只檔 player.swf 是可以擋掉七八成以上
http://pic.wretch.cc/icon/mp3player.swf?config=http://l.yimg.com/wretch.yimg.com/icon/mp3player.xml
http://pic.wretch.cc/photos/serv/video/video_player/BGMusicPlayer.swf
http://l.yimg.com/wretch.yimg.com/photos/icon/WretchFLVPlayer.swf
http://l.yimg.com/wretch.yimg.com/photos/serv/video/video_player/WretchPlayer.swf
http://l.yimg.com/wretch.yimg.com/photos/serv/video/video_player/BGMusicPlayer.swf
http://vlog.xuite.net/vlog/guest/external.php?media_id=$1=&pt=0&ar=0&as=0"
Thursday, February 28, 2008
squid - 使用 tempfs (RAM) 加速法
在大陸網站看到有人用 Memory 當 squid 的 cache_dir 效果不錯。自己試用之後真的非常快,只要開過的網頁再開,簡直可以說是"秒"殺,真的非常快。
只不過當 Ramdisk 使用快要滿了,在下載比較大的檔案會變的很慢,目前還在研究問題的原因。
0. cache_dir 的決定
通常是以主機記憶體大小的三分之一,例如記憶體 1G 則 cache_dir 大約 300M,如果記憶體剩餘的比較多,可能可以到二分之一。這個大小,可以依造執行的狀況,再調整。
1. 設定 tmpfs
有兩種方式
a. 在 /etc/fstab 加入
none /var/spool/squid tmpfs defaults,size=320M 0 0
b. 以指令方式建立
mount -t tmpfs -o size=320m none /var/spool/squid
有些人是用和 /tmp 綁定,目前我尚未使用所以無法評論,有空我實做後再把結論寫出來。
2. squid.conf.mem 設定
通常我會保留把原始設定保留起來,所以另外寫一個 squid.conf.mem 方便切換
cp /etc/squid/squid.conf.stand
舊的 squid.conf 複製一份為 squid.conf.stand
vi /etc/squid/squid.conf.mem
cache_mem 8
cache_dir ufs /var/spool/squid 320 8 256
cache_swap_low 85
cache_swap_high 95
說明:
cache momery 建議不要太大,預設是 8M ,這個大小已經足夠 1G 的 cache object使用,加上我們的 cache_dir 只有 320M。cache_dir 之前上面說明設定為 320 M。
有很多網站不管記憶體多少都將第一層目錄設成 16 這是錯的。應該是有人看到範例就直接抄過來,只改記憶體大小,後面兩個數字就直接照抄,完全不知道這個數字是怎麼來的。
cache_dir ufs /tmp 256 16 256
3. 啟動 script
為了啟動及關閉方便,寫了兩個 Script ,如果有機會,我再合併成一支執行。
vi startSquidMem.sh
#!/bin/sh
mount -t tmpfs -o size=320m none /var/spool/squid
chown squid:squid /var/spool/squid
mount /var/spool/squid
cp /etc/squid/squid.conf.mem /etc/squid/squid.conf
#squid -z
#建立 cache_dir, 不過現在的 /etc/init.d/squid 會檢查,如果沒有做會自己做)
/etc/init.d/squid start
vi stopSquidMem.sh
#!/bin/sh
/etc/init.d/squid stop
# 復原設定
cp /etc/squid/squid.conf.stand /etc/squid/squid.conf
只不過當 Ramdisk 使用快要滿了,在下載比較大的檔案會變的很慢,目前還在研究問題的原因。
0. cache_dir 的決定
通常是以主機記憶體大小的三分之一,例如記憶體 1G 則 cache_dir 大約 300M,如果記憶體剩餘的比較多,可能可以到二分之一。這個大小,可以依造執行的狀況,再調整。
1. 設定 tmpfs
有兩種方式
a. 在 /etc/fstab 加入
none /var/spool/squid tmpfs defaults,size=320M 0 0
b. 以指令方式建立
mount -t tmpfs -o size=320m none /var/spool/squid
有些人是用和 /tmp 綁定,目前我尚未使用所以無法評論,有空我實做後再把結論寫出來。
2. squid.conf.mem 設定
通常我會保留把原始設定保留起來,所以另外寫一個 squid.conf.mem 方便切換
cp /etc/squid/squid.conf.stand
舊的 squid.conf 複製一份為 squid.conf.stand
vi /etc/squid/squid.conf.mem
cache_mem 8
cache_dir ufs /var/spool/squid 320 8 256
cache_swap_low 85
cache_swap_high 95
說明:
cache momery 建議不要太大,預設是 8M ,這個大小已經足夠 1G 的 cache object使用,加上我們的 cache_dir 只有 320M。cache_dir 之前上面說明設定為 320 M。
有很多網站不管記憶體多少都將第一層目錄設成 16 這是錯的。應該是有人看到範例就直接抄過來,只改記憶體大小,後面兩個數字就直接照抄,完全不知道這個數字是怎麼來的。
cache_dir ufs /tmp 256 16 256
3. 啟動 script
為了啟動及關閉方便,寫了兩個 Script ,如果有機會,我再合併成一支執行。
vi startSquidMem.sh
#!/bin/sh
mount -t tmpfs -o size=320m none /var/spool/squid
chown squid:squid /var/spool/squid
mount /var/spool/squid
cp /etc/squid/squid.conf.mem /etc/squid/squid.conf
#squid -z
#建立 cache_dir, 不過現在的 /etc/init.d/squid 會檢查,如果沒有做會自己做)
/etc/init.d/squid start
vi stopSquidMem.sh
#!/bin/sh
/etc/init.d/squid stop
# 復原設定
cp /etc/squid/squid.conf.stand /etc/squid/squid.conf
Tuesday, December 11, 2007
squid NTLM 認證效能(未完)
ttl 請勿設太短 以免增加認證次數
external_acl_type nt_group ttl=3600 concurrency=20 %LOGIN
/usr/squid/libexec/wbinfo_group.pl
http://www.squid-cache.org/mail-archive/squid-users/200506/0757.html
external_acl_type nt_group ttl=3600 concurrency=20 %LOGIN
/usr/squid/libexec/wbinfo_group.pl
http://www.squid-cache.org/mail-archive/squid-users/200506/0757.html
Saturday, November 10, 2007
squid - 產生 sarg 的使用者名單
是這樣的 我要產生一個名單給 sarg 當作 使用者名單
好可以將 sarg 產出報表時根據這份名單把 工號 username 會變成帶有中文名
下面我是在 linux 去撈我們 AD 的工號及姓名
有需要的人可以參考一下 結果會大致如下
P0001 P0001 林大民
#!/bin/sh
net ads search "(&(sAMAccountName=P*)(objectclass=user))" sAMAccountName cn -U帳號%密碼 | grep -v "Got " |c
ut -d: -f2|paste -d" " - - -| awk '{print $2,$2,$1}' | grep P[0-9] | tr [:upper:] [:lower:] | sort > userlist
paste -d" " - - -
這是把三合併成一行
grep -v "Got" 這是濾掉 net ads search 出來
會有一行 Got XXX replies
awk '{print $2,$2,$1}'
將輸出結果 "林大民 P0001" 改成 "P0001 P0001 林大民"
tr [:upper:] [:lower:] -- 大寫轉小寫
proxy 裡的工號是小寫 所以將原本的大寫轉小寫
好可以將 sarg 產出報表時根據這份名單把 工號 username 會變成帶有中文名
下面我是在 linux 去撈我們 AD 的工號及姓名
有需要的人可以參考一下 結果會大致如下
P0001 P0001 林大民
#!/bin/sh
net ads search "(&(sAMAccountName=P*)(objectclass=user))" sAMAccountName cn -U帳號%密碼 | grep -v "Got " |c
ut -d: -f2|paste -d" " - - -| awk '{print $2,$2,$1}' | grep P[0-9] | tr [:upper:] [:lower:] | sort > userlist
paste -d" " - - -
這是把三合併成一行
grep -v "Got" 這是濾掉 net ads search 出來
會有一行 Got XXX replies
awk '{print $2,$2,$1}'
將輸出結果 "林大民 P0001" 改成 "P0001 P0001 林大民"
tr [:upper:] [:lower:] -- 大寫轉小寫
proxy 裡的工號是小寫 所以將原本的大寫轉小寫
Thursday, November 01, 2007
squid 安裝 - sarg 設定
1. Compile Sarg
# cd /usr/local/src
# tar -xvf sarg-2.2.3.1.tar.gz
# cd sarg-2.2.3.1
# ./configure --sysconfdir=/etc/sarg
# vi /etc/httpd/conf.d/sarg.conf
2. Setting Web Dir for Sarg
Alias /sarg /var/www/html/sarg
DirectoryIndex index.html
AllowOverride AuthConfig
#AuthType Basic
#AuthUserFile /var/www/html/sarg/.htaccess
#order deny,allow
#deny from all
#allow from 127.0.0.1
# cd /etc/squid/script
# wget http://www.initzero.it/products/opensource/sarg-reports/download/sarg-report
# mv sarg-report sarg-report.sh
# vi sarg-report sarg-report.sh
請改下面改成你需要的
HTMLOUT=/var/www/html/sarg -- sarg 網頁的目錄
LOGOIMG= Sarg 首頁 LOGO 網址
LOGOLINK=網址
DAILY=Daily -- Daily Report 的目錄名稱
WEEKLY=Weekly -- Weekly Report 的目錄名稱
MONTHLY=Monthly -- Monthly Report 的目錄名稱
# cd /usr/local/src
# tar -xvf sarg-2.2.3.1.tar.gz
# cd sarg-2.2.3.1
# ./configure --sysconfdir=/etc/sarg
# vi /etc/httpd/conf.d/sarg.conf
2. Setting Web Dir for Sarg
Alias /sarg /var/www/html/sarg
DirectoryIndex index.html
AllowOverride AuthConfig
#AuthType Basic
#AuthUserFile /var/www/html/sarg/.htaccess
#order deny,allow
#deny from all
#allow from 127.0.0.1
# cd /etc/squid/script
# wget http://www.initzero.it/products/opensource/sarg-reports/download/sarg-report
# mv sarg-report sarg-report.sh
# vi sarg-report sarg-report.sh
請改下面改成你需要的
HTMLOUT=/var/www/html/sarg -- sarg 網頁的目錄
LOGOIMG= Sarg 首頁 LOGO 網址
LOGOLINK=網址
DAILY=Daily -- Daily Report 的目錄名稱
WEEKLY=Weekly -- Weekly Report 的目錄名稱
MONTHLY=Monthly -- Monthly Report 的目錄名稱
Sunday, October 28, 2007
squid 安裝 - Squid.conf ACL 權限控制
這部分主要提供一個比較實務上可以運作的管控的範例
由於公司電腦是由 Windows AD 所管控,所以 Proxy 也將與 AD 結合。
AD 上建一個上網的群組,如 WebAccess,凡是有上網權限的使用者,必須是該群組成員。
上網的使用者必須 1. 電腦登入網域 2. 具有上網權限(即是 WebAccess 成員)
## NTLM 認證部份
# 若認證過慢 請增加 children 後的數字
# NT challenge Authentication for IE
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 50
auth_param ntlm max_challenge_reuses 0
auth_param ntlm max_challenge_lifetime 10 minutes
auth_param ntlm use_ntlm_negotiate on
# Plain Text Authentication for others
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 30
auth_param basic realm ABC Corp Proxy Server Login
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
external_acl_type NT_global_group ttl=300 children=25 %LOGIN /usr/lib/squid/wbinfo_group.pl
# acl : Access Control List 自訂項目
#
acl PASSWORD proxy_auth REQUIRED
acl GrpWebAccess external NT_global_group "/etc/squid/usergroup.acl"
deny_info ERR_NO_WEBACCESS_RIGHT GrpWebAccess
# Default:
#redirect_children 5
redirect_children 20
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 21 80 443 8080
acl connect method CONNECT
由於公司電腦是由 Windows AD 所管控,所以 Proxy 也將與 AD 結合。
AD 上建一個上網的群組,如 WebAccess,凡是有上網權限的使用者,必須是該群組成員。
上網的使用者必須 1. 電腦登入網域 2. 具有上網權限(即是 WebAccess 成員)
## NTLM 認證部份
# 若認證過慢 請增加 children 後的數字
# NT challenge Authentication for IE
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 50
auth_param ntlm max_challenge_reuses 0
auth_param ntlm max_challenge_lifetime 10 minutes
auth_param ntlm use_ntlm_negotiate on
# Plain Text Authentication for others
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 30
auth_param basic realm ABC Corp Proxy Server Login
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
external_acl_type NT_global_group ttl=300 children=25 %LOGIN /usr/lib/squid/wbinfo_group.pl
# acl : Access Control List 自訂項目
#
acl PASSWORD proxy_auth REQUIRED
acl GrpWebAccess external NT_global_group "/etc/squid/usergroup.acl"
deny_info ERR_NO_WEBACCESS_RIGHT GrpWebAccess
# Default:
#redirect_children 5
redirect_children 20
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 21 80 443 8080
acl connect method CONNECT
squid 安裝 - Squid.conf 基本設定
這部份主要是以公司的狀況為主,如果你的 Proxy 是在學校用的,請參考中山大學計中。
# http_port 是提供 Proxy Client 連接所使用的 Port,
#Default:
# http_port 3128
#http_port 10.254.6.192:8080
# 設定 proxy 使用的 port , icp 設為0 為不使用
http_port 8080
icp_port 0
# icp_query_timeout 設定 icp query timeout 的時間(ms)
# Default:
icp_query_timeout 0
#icp_query_timeout 1000
# 預設是關閉,目前尚未遇過網站需要此特別設定,故不建議變更預設值。
#ssl_unclean_shutdown on
# proxy 不 cache 檔案名為 cgi, asp, php3 ,
# 主要在使網頁中 cgi asp php3 等網頁能正常運作。
#Default:
# hierarchy_stoplist cgi-bin ?
hierarchy_stoplist cgi-bin ? .asp .cgi
#Default:
# acl QUERY urlpath_regex cgi-bin \?
# no_cache deny QUERY
#acl QUERY urlpath_regex cgi-bin \? \.php \.asp \.cgi
acl QUERY urlpath_regex cgi-bin \? \.cgi
no_cache deny QUERY
# proxy 所使用之實體記憶體(RAM),可設主機 RAM 之 三分之一左右,
# 但也應考慮該部主機是否尚有其他的服務,可酌量加減 !! ( 本機 RAM 為 256 MB )
#
# 配置給 squid 用的記憶體大小,約佔記憶體1/3弱,過多或過少都不好。
# Ex:128MB的記憶體,設定35~40MB便可。通常 Proxy Server 會把記憶體幾乎用之殆盡,
# 所以不適合跟其他服務在一起,故有時候會把記憶體的二分之一拿來當作 cache_mem。
# 注意一點:這並不是說 squid 只利用到這麼大的記憶體大小。
#Default:
# cache_mem 8 MB
# 本機記憶體為 2G, cache_mem 為 512MB
cache_mem 512 MB
#調整cache swap的高低水平,以維持cache資料有效率的置換
#Default:
# cache_swap_low 90
# cache_swap_high 95
cache_swap_low 80
cache_swap_high 95
# 當單一資料超過此大小便不 cache 在硬碟中,限制單一資料的『檔案的容量』。
# Default:
# maximum_object_size 4096 KB
# ref: http://www.linux-faqs.com/squid.php
#half_closed_clients off
maximum_object_size 2048 KB
#限制cache digests 可暫存 IP、Domain Name紀錄的容量。
#Default:
# ipcache_size 1024
# ipcache_low 90
# ipcache_high 95
ipcache_size 32768
ipcache_low 80
ipcache_high 95
# 完整主機名稱(FQDN)紀錄筆數。
#Default:
# fqdncache_size 1024
fqdncache_size 4096
# PROXY存放資料的位置及硬碟容量 第一層及第二層目錄數
# Default:
# cache_dir ufs /var/spool/squid 100 16 256
# 將來預計的設定
# cache_dir /var/spool/squid 4096 32 256
cache_dir diskd /cache1 8000 16 256
cache_dir diskd /cache2 8000 16 256
cache_dir diskd /cache3 8000 16 256
cache_dir diskd /cache4 8000 16 256
cache_dir diskd /cache5 8000 16 256
cache_dir diskd /cache6 8000 16 256
cache_dir diskd /cache7 8000 16 256
cache_dir diskd /cache8 8000 16 256
# 以下為各項系統記錄檔所在目錄設定。各 log file 設定如下:
# access.log 為 proxy 所有使用記錄檔。
# cache.log 為系統運作狀況記錄檔,應常去查看是否正常。
#
# 超重要!!!: 請記得在 crontab 中執行 /usr/bin/squid -k rotate 做每日定時
# 清除 log file,否則會因 log file 太大,而塞爆系統。
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_swap_log /var/log/squid/swap.log
# 這個項目設定儲存squid在cache空間儲存物件大小,時間等相關紀錄的紀錄檔儲存位置,
# 除非有必要,否則最好不要儲存它,因為它的檔案大小可是與妳的cache空間成正比的,
# 所以我們可以設定成none來關閉它。
# Default:
#cache_store_log /var/log/squid/store.log
cache_store_log none
#Default:
# logfile_rotate 0
# 保留六份 Logfile
logfile_rotate 6
# DNS 的執行個數,可自行調整
# 建議上限調成 32
#Default:
# dns_children 5
#dns_children 10
# http_port 是提供 Proxy Client 連接所使用的 Port,
#Default:
# http_port 3128
#http_port 10.254.6.192:8080
# 設定 proxy 使用的 port , icp 設為0 為不使用
http_port 8080
icp_port 0
# icp_query_timeout 設定 icp query timeout 的時間(ms)
# Default:
icp_query_timeout 0
#icp_query_timeout 1000
# 預設是關閉,目前尚未遇過網站需要此特別設定,故不建議變更預設值。
#ssl_unclean_shutdown on
# proxy 不 cache 檔案名為 cgi, asp, php3 ,
# 主要在使網頁中 cgi asp php3 等網頁能正常運作。
#Default:
# hierarchy_stoplist cgi-bin ?
hierarchy_stoplist cgi-bin ? .asp .cgi
#Default:
# acl QUERY urlpath_regex cgi-bin \?
# no_cache deny QUERY
#acl QUERY urlpath_regex cgi-bin \? \.php \.asp \.cgi
acl QUERY urlpath_regex cgi-bin \? \.cgi
no_cache deny QUERY
# proxy 所使用之實體記憶體(RAM),可設主機 RAM 之 三分之一左右,
# 但也應考慮該部主機是否尚有其他的服務,可酌量加減 !! ( 本機 RAM 為 256 MB )
#
# 配置給 squid 用的記憶體大小,約佔記憶體1/3弱,過多或過少都不好。
# Ex:128MB的記憶體,設定35~40MB便可。通常 Proxy Server 會把記憶體幾乎用之殆盡,
# 所以不適合跟其他服務在一起,故有時候會把記憶體的二分之一拿來當作 cache_mem。
# 注意一點:這並不是說 squid 只利用到這麼大的記憶體大小。
#Default:
# cache_mem 8 MB
# 本機記憶體為 2G, cache_mem 為 512MB
cache_mem 512 MB
#調整cache swap的高低水平,以維持cache資料有效率的置換
#Default:
# cache_swap_low 90
# cache_swap_high 95
cache_swap_low 80
cache_swap_high 95
# 當單一資料超過此大小便不 cache 在硬碟中,限制單一資料的『檔案的容量』。
# Default:
# maximum_object_size 4096 KB
# ref: http://www.linux-faqs.com/squid.php
#half_closed_clients off
maximum_object_size 2048 KB
#限制cache digests 可暫存 IP、Domain Name紀錄的容量。
#Default:
# ipcache_size 1024
# ipcache_low 90
# ipcache_high 95
ipcache_size 32768
ipcache_low 80
ipcache_high 95
# 完整主機名稱(FQDN)紀錄筆數。
#Default:
# fqdncache_size 1024
fqdncache_size 4096
# PROXY存放資料的位置及硬碟容量 第一層及第二層目錄數
# Default:
# cache_dir ufs /var/spool/squid 100 16 256
# 將來預計的設定
# cache_dir /var/spool/squid 4096 32 256
cache_dir diskd /cache1 8000 16 256
cache_dir diskd /cache2 8000 16 256
cache_dir diskd /cache3 8000 16 256
cache_dir diskd /cache4 8000 16 256
cache_dir diskd /cache5 8000 16 256
cache_dir diskd /cache6 8000 16 256
cache_dir diskd /cache7 8000 16 256
cache_dir diskd /cache8 8000 16 256
# 以下為各項系統記錄檔所在目錄設定。各 log file 設定如下:
# access.log 為 proxy 所有使用記錄檔。
# cache.log 為系統運作狀況記錄檔,應常去查看是否正常。
#
# 超重要!!!: 請記得在 crontab 中執行 /usr/bin/squid -k rotate 做每日定時
# 清除 log file,否則會因 log file 太大,而塞爆系統。
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_swap_log /var/log/squid/swap.log
# 這個項目設定儲存squid在cache空間儲存物件大小,時間等相關紀錄的紀錄檔儲存位置,
# 除非有必要,否則最好不要儲存它,因為它的檔案大小可是與妳的cache空間成正比的,
# 所以我們可以設定成none來關閉它。
# Default:
#cache_store_log /var/log/squid/store.log
cache_store_log none
#Default:
# logfile_rotate 0
# 保留六份 Logfile
logfile_rotate 6
# DNS 的執行個數,可自行調整
# 建議上限調成 32
#Default:
# dns_children 5
#dns_children 10
Saturday, October 27, 2007
squid 安裝 - 軟體安裝
- 檔案系統
為了加快系統效能,最佳武器就是 reiserfs
reiserfs 一般 Kernel 是沒有編譯進去的,要用就要自己編。
幸好有了 CentOS 完全不用自己來,現在已經放在 centosplus 裡
只要在 yum 打開就可以了
vi /etc/yum.repos.d/CentOS-Base.repo
[centosplus]
....
....
enabled=1
includepkgs=kernel* reiserfs-utils
做完後開始下 yum 安裝新的 kernel (kernel-2.6.9-XX.X.X.plus.c4) 及 reiserfs 的工具
yum update kernel
yum install reiserfs-utils
reiserfs 裡有一個 mkfs.reiserfs 可以將檔案格式化成 reiserfs 格式。
指令: mkfs.reiserfs /dev/sdaXX (XX為數字)
記得 CentOS-Base.repo 的 [base] [update]
要加上各加一行 exclude=kernel*
以免下次升級 kernel 時,升到原有的 kernel 而不是 [centosplus]
萬一好死不死 squid 死掉,重新開機後,系統用原有的 kernel 運作,
你會發現 squid 開不起來,因為 cache 目錄掛不上來。
Friday, October 26, 2007
squid 安裝 - 準備篇
最近要在一個新點裝一套 squid
在安裝之餘同時也將文件重新整理寫過 分享給大家
目前這套系統 準備提供給 20~100 人左右使用 所以硬體只用一台 PC
CentOS 4
Memory 1G~2G 左右
硬碟 160G
檔案系統規劃
/ 15~20G
事實上裝完 OS 是用不了那麼多 但有時候為了不小心讓 Log 寫滿 / 導致 Squid 停下來
/boot 100M
不用多,預設 100 M 就好
SWAP
一般記憶體兩倍, RAM 1G, SWAP 就 2G
/cache1 ~ /cache8
Squid 將所有快取的物件存放在 cache 目錄哩,
為了效能考量,通常會建好幾個 cache 目錄,以能均勻打散 cache 物件。
一般我已經習慣用 8 個 cache 目錄, 每個目錄大小 8 G 為準則。
目錄不一定要這麼多 ,但最好是 2 的次方,如 2, 4 , 8。
cache 目錄大小定 8G , 8 G 已經是相當夠用了,
除非你的 Site 很大,使用的人很多,就另當別論。
如果可以的話最好用 reiserfs 檔案系統 效能會快很多
/backup
剩下的空間就給他,以後產出來的 log 就移到這邊放
在安裝之餘同時也將文件重新整理寫過 分享給大家
目前這套系統 準備提供給 20~100 人左右使用 所以硬體只用一台 PC
CentOS 4
Memory 1G~2G 左右
硬碟 160G
檔案系統規劃
/ 15~20G
事實上裝完 OS 是用不了那麼多 但有時候為了不小心讓 Log 寫滿 / 導致 Squid 停下來
/boot 100M
不用多,預設 100 M 就好
SWAP
一般記憶體兩倍, RAM 1G, SWAP 就 2G
/cache1 ~ /cache8
Squid 將所有快取的物件存放在 cache 目錄哩,
為了效能考量,通常會建好幾個 cache 目錄,以能均勻打散 cache 物件。
一般我已經習慣用 8 個 cache 目錄, 每個目錄大小 8 G 為準則。
目錄不一定要這麼多 ,但最好是 2 的次方,如 2, 4 , 8。
cache 目錄大小定 8G , 8 G 已經是相當夠用了,
除非你的 Site 很大,使用的人很多,就另當別論。
如果可以的話最好用 reiserfs 檔案系統 效能會快很多
/backup
剩下的空間就給他,以後產出來的 log 就移到這邊放
Thursday, October 25, 2007
squidGuard.cgi 問題
squidGuard.cgi 無法執行的原因
第一行請改
#!/usr/bin/perl -wt
環境是 CentOS4 Apache2
ref http://lauely.blog.zj.com/blog/d-51811.html
第一行請改
#!/usr/bin/perl -wt
環境是 CentOS4 Apache2
ref http://lauely.blog.zj.com/blog/d-51811.html
Thursday, December 14, 2006
Squid : 解救 Invalid Response 的網頁 - relaxed_header_parser on
之前我文章有提過 上 http://sii.tse.com.tw 會出現下面的錯誤訊息
ERROR
The requested URL could not be retrieved
--------------------------------------------------------------------------------
While trying to process the request:
GET / HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-icq, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-TW
Proxy-Connection: Keep-Alive
If-Modified-Since: Wed, 29 Nov 2006 01:05:45 GMT; length=14906
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; IEMB3)
Host: sii.tse.com.tw
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAGQAAAAYABgAfAAAAAQABABIAAAACgAKAEwAAAAOAA4AVgAAAAAAAACUAAAABYKIIgUBKAoAAAAPVABDAHAANAAzADIAMwAzAFEASgBaAEwAMQBTALjPNZk2jsKNAAAAAAAAAAAAAAAAAAAAAFpLr1fvdFTabDl01lYpPRXBMGBKt0ILqX==
The following error was encountered:
Invalid Response
The HTTP Response message received from the contacted server could not be understood or was otherwise malformed. Please contact the site operator. Your cache administrator may be able to provide you with more details about the exact nature of the problem if needed.
Your cache administrator is root.
現在我終於查出原因了 是某些網頁的 Header 的問題
在 squid.conf 請不要不要將 relaxed_header_parser 設成 off
請用 relaxed_header_parser on
中山大學圖書館電子資料庫 ezproxy 如果用 squid 也會遇到同樣的問題
http://www.lib.nsysu.edu.tw/database/search/DatabasesList.asp?Language=%A6%E8%A4%E5
以下為 squid.conf - relaxed_header_parser 的說明
# TAG: relaxed_header_parser on|off|warn
# In the default "on" setting Squid accepts certain forms
# of non-compliant HTTP messages where it is unambiguous
# what the sending application intended even if the message
# is not correctly formatted. The messages is then normalized
# to the correct form when forwarded by Squid.
#
# If set to "warn" then a warning will be emitted in cache.log
# each time such HTTP error is encountered.
#
# If set to "off" then such HTTP errors will cause the request
# or response to be rejected.
#
ERROR
The requested URL could not be retrieved
--------------------------------------------------------------------------------
While trying to process the request:
GET / HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-icq, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-TW
Proxy-Connection: Keep-Alive
If-Modified-Since: Wed, 29 Nov 2006 01:05:45 GMT; length=14906
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; IEMB3)
Host: sii.tse.com.tw
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAGQAAAAYABgAfAAAAAQABABIAAAACgAKAEwAAAAOAA4AVgAAAAAAAACUAAAABYKIIgUBKAoAAAAPVABDAHAANAAzADIAMwAzAFEASgBaAEwAMQBTALjPNZk2jsKNAAAAAAAAAAAAAAAAAAAAAFpLr1fvdFTabDl01lYpPRXBMGBKt0ILqX==
The following error was encountered:
Invalid Response
The HTTP Response message received from the contacted server could not be understood or was otherwise malformed. Please contact the site operator. Your cache administrator may be able to provide you with more details about the exact nature of the problem if needed.
Your cache administrator is root.
現在我終於查出原因了 是某些網頁的 Header 的問題
在 squid.conf 請不要不要將 relaxed_header_parser 設成 off
請用 relaxed_header_parser on
中山大學圖書館電子資料庫 ezproxy 如果用 squid 也會遇到同樣的問題
http://www.lib.nsysu.edu.tw/database/search/DatabasesList.asp?Language=%A6%E8%A4%E5
以下為 squid.conf - relaxed_header_parser 的說明
# TAG: relaxed_header_parser on|off|warn
# In the default "on" setting Squid accepts certain forms
# of non-compliant HTTP messages where it is unambiguous
# what the sending application intended even if the message
# is not correctly formatted. The messages is then normalized
# to the correct form when forwarded by Squid.
#
# If set to "warn" then a warning will be emitted in cache.log
# each time such HTTP error is encountered.
#
# If set to "off" then such HTTP errors will cause the request
# or response to be rejected.
#
Wednesday, December 06, 2006
Squid report - Sarg 程式安裝與設定
SARG - Squid Analysis Report Generator
顧名思義 就是產生 Squid Report
下載網址 http://sarg.sf.net/
如果要使用繪圖功能請安裝 gd-devel
程式安裝步驟
1. run ./configure
configure options:
--enable-bindir=where sarg binary will be saved
default: /usr/bin
--enable-sysconfdir - where the configuration directory is
default: /usr/local/sarg
--enable-htmldir - where the www html root dir is
default: /var/www/html
--enable-mandir - where the sarg man page will be saved
default: /usr/local/man/man1
這裡我們用
./configure --enable-sysconfdir=/etc/sarg --with-gd
2. make
3. make install
4. Go to /etc/sarg (or file entered with --sysconfdir on configure)
and change sarg.conf as you need.
建議可以修改的選項
a. 基本選項
access_log /var/log/squid/access.log
output_dir /var/www/html/sarg
overwrite_report yes
b. 如果有使用 gd 畫圖
charset Windows-1251
c. 如果 Squid 整合 AD
ntlm_user_format domainname+username
顧名思義 就是產生 Squid Report
下載網址 http://sarg.sf.net/
如果要使用繪圖功能請安裝 gd-devel
程式安裝步驟
1. run ./configure
configure options:
--enable-bindir=where sarg binary will be saved
default: /usr/bin
--enable-sysconfdir - where the configuration directory is
default: /usr/local/sarg
--enable-htmldir - where the www html root dir is
default: /var/www/html
--enable-mandir - where the sarg man page will be saved
default: /usr/local/man/man1
這裡我們用
./configure --enable-sysconfdir=/etc/sarg --with-gd
2. make
3. make install
4. Go to /etc/sarg (or file entered with --sysconfdir on configure)
and change sarg.conf as you need.
建議可以修改的選項
a. 基本選項
access_log /var/log/squid/access.log
output_dir /var/www/html/sarg
overwrite_report yes
b. 如果有使用 gd 畫圖
charset Windows-1251
c. 如果 Squid 整合 AD
ntlm_user_format domainname+username
Thursday, November 30, 2006
Squid : 廣播清單
哈~ 找到廣播的網址 這些將成為 Squid Block 的清單
通常 我會讓 User 看的到網站 但又不能聽的到
以中華電信為例 讓 http://radio.hinet.net 可以過
然後用 squidGuard 檔下面的網址
radio.hinet.net/radio/player/player.jsp (第一道)
grm.cdn.hinet.net/media/radio/play.asp (第二道)
基本上 中華電信已經不提供直接用 mms 連
一定要透過 player.asp 再呼叫 play.asp 連線
最後才是 live.media.hinet.net 這整個 domain
如果第一關都進不了 就別想聽廣播了
換句話說你也可以只檔第一道就可以了
中文廣播清單(* 表示 check 中,x 疑似消失中,o 表示 check ok)
*Kiss Radio 大眾廣播=mms://203.187.31.160/khkiss
*交通網台中臺 FM 94.5 =mms://210.61.218.114/live.media.hinet.net/prs05
*台北之音線 FM107.7=mms://203.187.31.160/FM1077
*交通網台北臺 FM 94.3 FM 94.3=mms://210.61.218.114/live.media.hinet.net/prs02
*全國交通網 FM 104.9=mms://210.61.218.114/live.media.hinet.net/prs01
x音樂罐頭網路電臺=mms://wms9.elta.com.tw/music-can
o中廣新聞網=mms://live.media.hinet.net/Radio_BCC-NEWS
o中廣音樂網=mms://live.media.hinet.net/Radio_BCC-MUSIC
o中廣流行網=mms://live.media.hinet.net/Radio_BCC-POP
o中廣古典網=mms://live.media.hinet.net/Radio_BCC_CLASIC
o中廣客家頻道=mms://live.media.hinet.net/Radio_BCC-HAKKA
o Real中廣晨間新聞=http://203.69.33.10/mnews.ram
o Real中廣晚間新聞=http://203.69.33.10/enews.ram
中央廣播電臺-新聞網=mms://live.media.hinet.net/CBS1
中央廣播電臺-綜合網=mms://live.media.hinet.net/CBS2
中央廣播電臺-國際網=mms://live.media.hinet.net/CBS3
中央廣播電臺-音樂網=mms://live.media.hinet.net/CBS4
中央廣播電臺-亞洲語網=mms://live.media.hinet.net/CBS5
中央廣播電臺-方言網=mms://live.media.hinet.net/CBS6
台北之音HitFm(FM107.7)=http://203.187.31.160/FM1077
台北之音HitFm(FM91.7)=http://203.187.31.160/FM917
台北愛樂電臺=http://203.187.31.160:80/fm997
台北廣播電臺 FM93.1=mms://live.media.hinet.net/TCGRADIO
好事聯播網-台北FM98.9=mms://live.media.hinet.net/best983
東森ETFM聯播網=mms://210.58.102.100/etfm-live
News98=mms://live.media.hinet.net/news98
飛碟電臺-國語流行臺Media=mms://live.media.hinet.net/ufo_music3
飛碟電臺-國語經典臺Media=mms://live.media.hinet.net/ufo_music1
飛碟電臺-外語流行廣播Media=mms://live.media.hinet.net/ufo_music4
飛碟電臺-英語經典臺Media=mms://live.media.hinet.net/ufo_music2
飛碟電臺-網線上即時廣播Media=mms://live.media.hinet.net/ufo
漢聲電臺AM=mms://live.media.hinet.net/VHBN-AM
漢聲電臺FM=mms://live.media.hinet.net/VHBN-FM
警察廣播電臺-台北臺=mms://live.media.hinet.net/prs02
警察廣播電臺長青網=mms://live.media.hinet.net/prs03
警廣全國臺=mms://live.media.hinet.net/prs01
台中廣播電臺
FM100.4~FM100.7=mms://live.media.hinet.net/lucky7?RADIOA2815D1F-299A-480E-988A-B3FE04317B0D
正聲廣播AM819=mms://live.media.hinet.net/csbc02
正聲廣播FM1041=mms://live.media.hinet.net/csbc01
佳音電臺=http://www.voiceofhope.com/realhtml/live.ram
太陽廣播電臺FM89.1=mms://wms9.elta.com.tw/fm891
好事聯播網-山海屯電臺=mms://live.media.hinet.net/best903?RADIOA8AE6AB2-BA60-4FAF-B8AF-EB6E1205D581
環宇廣播電臺=mms://210.243.236.17:8080/
ICRT=http://live.giga.net.tw/icrt16.asx
台中大千=http://live.giga.net.tw/tcbig1000.asx
警廣台中臺=mms://live.media.hinet.net/prs05
好事聯播網-港都電臺=mms://live.media.hinet.net/best983?RADIO2E4B973F-D881-420B-B56F-59F41391569C
警廣高雄臺=mms://live.media.hinet.net/prs07
台灣新聲TNT(FM 98.5)=mms://203.187.31.160/superfm985
通常 我會讓 User 看的到網站 但又不能聽的到
以中華電信為例 讓 http://radio.hinet.net 可以過
然後用 squidGuard 檔下面的網址
radio.hinet.net/radio/player/player.jsp (第一道)
grm.cdn.hinet.net/media/radio/play.asp (第二道)
基本上 中華電信已經不提供直接用 mms 連
一定要透過 player.asp 再呼叫 play.asp 連線
最後才是 live.media.hinet.net 這整個 domain
如果第一關都進不了 就別想聽廣播了
換句話說你也可以只檔第一道就可以了
中文廣播清單(* 表示 check 中,x 疑似消失中,o 表示 check ok)
*Kiss Radio 大眾廣播=mms://203.187.31.160/khkiss
*交通網台中臺 FM 94.5 =mms://210.61.218.114/live.media.hinet.net/prs05
*台北之音線 FM107.7=mms://203.187.31.160/FM1077
*交通網台北臺 FM 94.3 FM 94.3=mms://210.61.218.114/live.media.hinet.net/prs02
*全國交通網 FM 104.9=mms://210.61.218.114/live.media.hinet.net/prs01
x音樂罐頭網路電臺=mms://wms9.elta.com.tw/music-can
o中廣新聞網=mms://live.media.hinet.net/Radio_BCC-NEWS
o中廣音樂網=mms://live.media.hinet.net/Radio_BCC-MUSIC
o中廣流行網=mms://live.media.hinet.net/Radio_BCC-POP
o中廣古典網=mms://live.media.hinet.net/Radio_BCC_CLASIC
o中廣客家頻道=mms://live.media.hinet.net/Radio_BCC-HAKKA
o Real中廣晨間新聞=http://203.69.33.10/mnews.ram
o Real中廣晚間新聞=http://203.69.33.10/enews.ram
中央廣播電臺-新聞網=mms://live.media.hinet.net/CBS1
中央廣播電臺-綜合網=mms://live.media.hinet.net/CBS2
中央廣播電臺-國際網=mms://live.media.hinet.net/CBS3
中央廣播電臺-音樂網=mms://live.media.hinet.net/CBS4
中央廣播電臺-亞洲語網=mms://live.media.hinet.net/CBS5
中央廣播電臺-方言網=mms://live.media.hinet.net/CBS6
台北之音HitFm(FM107.7)=http://203.187.31.160/FM1077
台北之音HitFm(FM91.7)=http://203.187.31.160/FM917
台北愛樂電臺=http://203.187.31.160:80/fm997
台北廣播電臺 FM93.1=mms://live.media.hinet.net/TCGRADIO
好事聯播網-台北FM98.9=mms://live.media.hinet.net/best983
東森ETFM聯播網=mms://210.58.102.100/etfm-live
News98=mms://live.media.hinet.net/news98
飛碟電臺-國語流行臺Media=mms://live.media.hinet.net/ufo_music3
飛碟電臺-國語經典臺Media=mms://live.media.hinet.net/ufo_music1
飛碟電臺-外語流行廣播Media=mms://live.media.hinet.net/ufo_music4
飛碟電臺-英語經典臺Media=mms://live.media.hinet.net/ufo_music2
飛碟電臺-網線上即時廣播Media=mms://live.media.hinet.net/ufo
漢聲電臺AM=mms://live.media.hinet.net/VHBN-AM
漢聲電臺FM=mms://live.media.hinet.net/VHBN-FM
警察廣播電臺-台北臺=mms://live.media.hinet.net/prs02
警察廣播電臺長青網=mms://live.media.hinet.net/prs03
警廣全國臺=mms://live.media.hinet.net/prs01
台中廣播電臺
FM100.4~FM100.7=mms://live.media.hinet.net/lucky7?RADIOA2815D1F-299A-480E-988A-B3FE04317B0D
正聲廣播AM819=mms://live.media.hinet.net/csbc02
正聲廣播FM1041=mms://live.media.hinet.net/csbc01
佳音電臺=http://www.voiceofhope.com/realhtml/live.ram
太陽廣播電臺FM89.1=mms://wms9.elta.com.tw/fm891
好事聯播網-山海屯電臺=mms://live.media.hinet.net/best903?RADIOA8AE6AB2-BA60-4FAF-B8AF-EB6E1205D581
環宇廣播電臺=mms://210.243.236.17:8080/
ICRT=http://live.giga.net.tw/icrt16.asx
台中大千=http://live.giga.net.tw/tcbig1000.asx
警廣台中臺=mms://live.media.hinet.net/prs05
好事聯播網-港都電臺=mms://live.media.hinet.net/best983?RADIO2E4B973F-D881-420B-B56F-59F41391569C
警廣高雄臺=mms://live.media.hinet.net/prs07
台灣新聲TNT(FM 98.5)=mms://203.187.31.160/superfm985
Wednesday, November 29, 2006
Squid : sii.tse.com.tw 連線有問題
ssi.tse.com.tw 是使用 Java Composer Server 2.1
用 Netcraft 查
-> http://toolbar.netcraft.com/site_report?url=http://sii.tse.com.tw
很多 Squid 2.5.X 版本瀏覽這種網站都會有這種問題
不過目前所知 只剩下兩三個這樣的網站
ERROR
The requested URL could not be retrieved
--------------------------------------------------------------------------------
While trying to process the request:
GET / HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-icq, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-TW
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAFYAAAAYABgAbgAAAAIAAgBIAAAABQAFAEoAAAAHAAcATwAAAAAAAACGAAAABgIAAgUBKAoAAAAPVENQNDMyMzNRSlpMMVNa9fEVgWavfhlxr0rq32/47tQmQbwO7MLqoRs8FMFKX4YuAvegkV7F3s+YiELQvQd=
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; IEMB3)
Host: sii.tse.com.tw
Proxy-Connection: Keep-Alive
The following error was encountered:
Invalid Response
The HTTP Response message received from the contacted server could not be understood or was otherwise malformed. Please contact the site operator. Your cache administrator may be able to provide you with more details about the exact nature of the problem if needed.
用 Netcraft 查
-> http://toolbar.netcraft.com/site_report?url=http://sii.tse.com.tw
很多 Squid 2.5.X 版本瀏覽這種網站都會有這種問題
不過目前所知 只剩下兩三個這樣的網站
ERROR
The requested URL could not be retrieved
--------------------------------------------------------------------------------
While trying to process the request:
GET / HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-icq, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-TW
Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAFYAAAAYABgAbgAAAAIAAgBIAAAABQAFAEoAAAAHAAcATwAAAAAAAACGAAAABgIAAgUBKAoAAAAPVENQNDMyMzNRSlpMMVNa9fEVgWavfhlxr0rq32/47tQmQbwO7MLqoRs8FMFKX4YuAvegkV7F3s+YiELQvQd=
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; IEMB3)
Host: sii.tse.com.tw
Proxy-Connection: Keep-Alive
The following error was encountered:
Invalid Response
The HTTP Response message received from the contacted server could not be understood or was otherwise malformed. Please contact the site operator. Your cache administrator may be able to provide you with more details about the exact nature of the problem if needed.
Saturday, November 25, 2006
Squid: Block Skype with squid
# Prevent Skype connecting HTTPs using CONNECT requests to IP addresses (those not using domain names)
acl numeric_IPs url_regex ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
http_access deny CONNECT numeric_IPs all
# Prevent Skype connecting http
acl Skype_UA browser Skype
http_access deny Skype_UA
# Prevent anyone to download anything from skype website
acl Skype_domain dstdomain skype.com
http_access deny Skype_domain
acl numeric_IPs url_regex ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
http_access deny CONNECT numeric_IPs all
# Prevent Skype connecting http
acl Skype_UA browser Skype
http_access deny Skype_UA
# Prevent anyone to download anything from skype website
acl Skype_domain dstdomain skype.com
http_access deny Skype_domain
Squid : Block Spyware with DNS
Squid 去 block spyware 除了用 squidGuard 之外
還可以用什麼方法?
找到一篇用 DNS 來阻斷的方法
原理很簡單 把 spyware 的 domain 加到 DNS Server
只要有人 query 就直接回 127.0.0.1
IT 就不用每台去加 /etc/hosts 了
作者還貼心提供 update script - update.sh 更新
Malware Prevention through black-hole DNS
http://www.bleedingsnort.com/blackhole-dns
或是 另外一個 sa-blacklist
http://www.sa-blacklist.stearns.org/sa-blacklist/
還可以用什麼方法?
找到一篇用 DNS 來阻斷的方法
原理很簡單 把 spyware 的 domain 加到 DNS Server
只要有人 query 就直接回 127.0.0.1
IT 就不用每台去加 /etc/hosts 了
作者還貼心提供 update script - update.sh 更新
Malware Prevention through black-hole DNS
http://www.bleedingsnort.com/blackhole-dns
或是 另外一個 sa-blacklist
http://www.sa-blacklist.stearns.org/sa-blacklist/
Subscribe to:
Posts (Atom)
