日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

应用squid全面加速web(全)

發布時間:2025/3/15 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 应用squid全面加速web(全) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
############################################### 模式1:Squid對應多臺web服務器
在vi /etc/hosts中:加入內部的DNS解析,比如:
192.168.0.9???
www.winkee.com
192.168.0.66??? bbs.winkee.com
A2、#vi /Data/apps/squid/etc/squid.conf
代碼如下:
# visible name
visible_hostname cache.winkee.com
# cache config: space use 1G and memory use 256M
cache_dir ufs /Data/apps/squid/cache 1024 16 256
cache_mem 256 MB
cache_effective_user squid? #設置運行時的用戶和組權限
cache_effective_group squid
# 反向加速配置
http_port 80?? # squid監聽的端口,客戶訪問網站的端口
httpd_accel_host virtual? # WEB服務器的IP地址,此模式下設置為:virtual
httpd_accel_single_host off? # 設置on時緩沖請求到單臺Server,off對應virtual
httpd_accel_port 80? # WEB服務器的端口(對于多臺web服務器,端口必須一致)
httpd_accel_uses_host_header on? # 完成多個WEB服務器的反向代理功能
httpd_accel_with_proxy off??? # 停用代理本地上網
# accelerater my domain only
acl HostA dstdomain?
www.winkee.com
acl HostB dstdomain? bbs.winkee.com
# accelerater http protocol on port 80
acl acceleratedProtocol protocol HTTP
acl acceleratedPort port 80
# access arc
acl all src 0.0.0.0/0.0.0.0
# Allow requests when they are to the accelerated machine AND to the right port with right protocol
http_access allow acceleratedProtocol acceleratedPort HostA
http_access allow acceleratedProtocol acceleratedPort HostB
http_access allow all
# logging
emulate_httpd_log on
cache_store_log none
# manager
acl manager proto cache_object
http_access allow manager all
cachemgr_passwd pass all
cache_mgr
admin@winkee.com
#swap 性能微調
half_closed_clients off
cache_swap_high 100%
cache_swap_low 95%
maximum_object_size 1024 KB
# 控制對象的超時時間 (S_Data-Data)<Min+(Max-Min)*90%
refresh_pattern -i .html 60 90% 10080 reload-into-ims
#refresh_pattern -i \.html$ 60 90% 10080 reload-into-ims
refresh_pattern -i .png 60 90% 10080 reload-into-ims
refresh_pattern -i .jpg 1440 90% 129600 reload-into-ims
refresh_pattern -i .gif 1440 90% 129600 reload-into-ims
refresh_pattern -i .js 1440 90% 10080 reload-into-ims
refresh_pattern -i .swf 1440 90% 129600 reload-into-ims
refresh_pattern -i .bmp 1440 90% 129600 reload-into-ims
# refresh_pattern -i .shtml 1440 90% 129600 reload-into-ims
# refresh_pattern -i .hml 1440 90% 129600 reload-into-ims
# 禁止緩存
hierarchy_stoplist cgi-bin ?
hierarchy_stoplist -i ^https:\\ ?
acl QUERY urlpath_regex -i cgi-bin \? \.php \.xml
acl denyssl urlpath_regex -i ^https:\\
no_cache deny QUERY
no_cache deny denyssl
#logfile_rotate 可以用logfile_rotate 0來取消自動操作
logfile_rotate 4[/quote]
########################################################
模式2:Squid 與 web是單獨兩臺服務器
# vi /Data/apps/squid/etc/squid.conf? 代碼如下:
# visible name
visible_hostname cache.winkee.com
# cache config: space use 1G and memory use 256M
cache_dir ufs /Data/apps/squid/cache 1024 16 256
cache_mem 256 MB
cache_effective_user squid? #設置運行時的用戶和組權限
cache_effective_group squid
# 反向加速配置
http_port 80?? # squid監聽的端口,客戶訪問網站的端口
httpd_accel_host ip_address? # WEB服務器的IP地址
httpd_accel_single_host on # 設置轉發為緩沖的請求到一臺單獨的機器
httpd_accel_port 80??? # WEB服務器的端口
httpd_accel_uses_host_header off? # 完成單臺WEB服務器的反向代理功能
httpd_accel_with_proxy off??? # 停用代理本地上網
# accelerater my domain only
acl HostA dst ip_address # WEB服務器的IP地址
# accelerater http protocol on port 80
acl acceleratedProtocol protocol HTTP
acl acceleratedPort port 80
# access arc
acl all src 0.0.0.0/0.0.0.0
# Allow requests when they are to the accelerated machine AND to the right port with right protocol
http_access allow acceleratedProtocol acceleratedPort HostA
http_access allow all
# logging
emulate_httpd_log on
cache_store_log none
# manager
acl manager proto cache_object
http_access allow manager all
cachemgr_passwd pass all
cache_mgr
admin@winkee.com
#swap 性能微調
half_closed_clients off
cache_swap_high 100%
cache_swap_low 95%
maximum_object_size 1024 KB
# 控制對象的超時時間 (S_Data-Data)<Min+(Max-Min)*90%
refresh_pattern -i .html 60 90% 10080 reload-into-ims
refresh_pattern -i .png 60 90% 10080 reload-into-ims
refresh_pattern -i .jpg 1440 90% 129600 reload-into-ims
refresh_pattern -i .gif 1440 90% 129600 reload-into-ims
refresh_pattern -i .js 1440 90% 10080 reload-into-ims
refresh_pattern -i .swf 1440 90% 129600 reload-into-ims
refresh_pattern -i .bmp 1440 90% 129600 reload-into-ims
# refresh_pattern -i .shtml 1440 90% 129600 reload-into-ims
# refresh_pattern -i .hml 1440 90% 129600 reload-into-ims
# 禁止緩存
hierarchy_stoplist cgi-bin ?
hierarchy_stoplist -i ^https:\\ ?
acl QUERY urlpath_regex -i cgi-bin \? \.php \.xml
acl denyssl urlpath_regex -i ^https:\\
no_cache deny QUERY
no_cache deny denyssl
#logfile_rotate 可以用logfile_rotate 0來取消自動操作
logfile_rotate 4
###########################################################
模式3:Squid 與 Web是同一臺服務器
# vi /Data/apps/squid/etc/squid.conf? 代碼如下:
# visible name
visible_hostname cache.winkee.com
# cache config: space use 1G and memory use 256M
cache_dir ufs /Data/apps/squid/cache 1024 16 256
cache_mem 256 MB
cache_effective_user squid? #設置運行時的用戶和組權限
cache_effective_group squid
# 反向加速配置
http_port 80?? # squid監聽的端口,客戶訪問網站的端口
httpd_accel_host ip_address? # WEB服務器的IP地址
httpd_accel_single_host on # 設置轉發為緩沖的請求到一臺單獨的機器
httpd_accel_port 81??? # WEB服務器的端口
httpd_accel_uses_host_header off? # 完成單臺WEB服務器的反向代理功能
httpd_accel_with_proxy off??? # 停用代理本地上網
# accelerater my domain only
acl HostA dst ip_address # WEB服務器的IP地址
# accelerater http protocol on port 80
acl acceleratedProtocol protocol HTTP
acl acceleratedPort port 80
# access arc
acl all src 0.0.0.0/0.0.0.0
# Allow requests when they are to the accelerated machine AND to the right port with right protocol
http_access allow acceleratedProtocol acceleratedPort HostA
http_access allow all
# logging
emulate_httpd_log on
cache_store_log none
# manager
acl manager proto cache_object
http_access allow manager all
cachemgr_passwd pass all
cache_mgr
admin@winkee.com
#swap 性能微調
half_closed_clients off
cache_swap_high 100%
cache_swap_low 95%
maximum_object_size 1024 KB
# 控制對象的超時時間 (S_Data-Data)<Min+(Max-Min)*90%
refresh_pattern -i .html 60 90% 10080 reload-into-ims
refresh_pattern -i .png 60 90% 10080 reload-into-ims
refresh_pattern -i .jpg 1440 90% 129600 reload-into-ims
refresh_pattern -i .gif 1440 90% 129600 reload-into-ims
refresh_pattern -i .js 1440 90% 10080 reload-into-ims
refresh_pattern -i .swf 1440 90% 129600 reload-into-ims
refresh_pattern -i .bmp 1440 90% 129600 reload-into-ims
# refresh_pattern -i .shtml 1440 90% 129600 reload-into-ims
# refresh_pattern -i .hml 1440 90% 129600 reload-into-ims
# 禁止緩存
hierarchy_stoplist cgi-bin ?
hierarchy_stoplist -i ^https:\\ ?
acl QUERY urlpath_regex -i cgi-bin \? \.php \.xml
acl denyssl urlpath_regex -i ^https:\\
no_cache deny QUERY
no_cache deny denyssl
# logfile_rotate 可以用logfile_rotate 0來取消自動操作
logfile_rotate 4
Setp 3 –Starting Squid
1、??? 創建緩存目錄
# cd /Data/apps/squid/sbin
#./squid –z?? # 出現Creating Swap Directories提示,表示建立成功
2、??? 運行Squid
# cd /Data/apps/squid/sbin
#./squid –NCd1 # 成功后將出現"Ready to serve requests".否則請檢查配置文件
說明,用squid -NCd1來以debug模式啟動,這樣如果有錯誤會報出來,一般如果是ADSL撥號的,那么在沒有撥號之前就啟動squid的話是會出錯的(FATAL: ipcache_init: DNS name lookup tests failed),因為squid啟動時會去檢查一些常用的DNS,但是這時候你并沒有接入internet,自然就出錯了,所以我們需要在啟動的時候不檢查DNS,這就需要用加上-D選項來啟動squid,命令如下:
#./squid –NCDd1 # 參數Dd1的目的是禁止測試DNS的連通性并且把squid在開始運行后的一些提示信息顯示在屏幕上)
注意事項:
1、Squid的配置文件squid.conf更改后必須重新運行squid
2、Squid服務器的hosts文件更改后必須重新運行squid

轉載于:https://blog.51cto.com/sookk8/234488

總結

以上是生活随笔為你收集整理的应用squid全面加速web(全)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 国产淫语| 蜜臀久久精品久久久久久酒店 | 天天操欧美 | 亚洲中文字幕无码av永久 | 国产欧美精品一区二区 | 日日噜噜噜夜夜爽爽狠狠 | 麻豆69xxnxxporn| 国产精品亚洲综合 | av资源库| 日本高清不卡视频 | 推特裸体gay猛交gay | 欧美黑丝少妇 | 久久精品一区二区三区四区 | 日本免费在线观看视频 | 欧美日韩在线观看一区二区 | 国产午夜亚洲精品午夜鲁丝片 | 国产极品粉嫩 | 一级免费视频 | 国产小视频免费 | 亚洲精品6 | 国产剧情在线观看 | 欧美在线视频一区二区 | 91免费精品视频 | 成人一区电影 | 久久久久成人精品无码 | 小早川怜子一区二区三区 | 亚洲午夜久久久久久久久久久 | 国产三级91 | 色黄视频在线观看 | 久草视频在线看 | 欧美精选一区 | 激情伊人 | 视频在线播 | 国产成人免费在线视频 | 久久精品性爱视频 | 告诉我真相俄剧在线观看 | 日本伦理片在线播放 | 黄色大片久久 | 天天操天天插天天干 | 偷拍久久久| a人片 | 国产精品极品白嫩在线 | 亚洲天堂一区二区三区四区 | 日本不卡一区二区三区在线观看 | 欧美骚视频| 亚洲美女av网站 | 久草一本 | 性网站在线观看 | 大尺度做爰啪啪床戏 | 午夜精品影院 | 在线视频精品一区 | 小毛片在线观看 | 日韩在线影院 | 国产欧美精品在线 | 动漫精品一区 | 综合九九 | 超碰青草| 成人一区二区电影 | 欧美tv| 狠狠人妻久久久久久综合麻豆 | 国产aⅴ爽av久久久久成人 | 91视频国产免费 | 波多野吉衣一区二区 | 天天看天天操 | 欧美50p| 榴莲视频黄色 | 亚洲精品久久久久av无码 | 91精品91久久久中77777 | 欧美日韩三级 | 男生女生羞羞网站 | 欧美乱妇狂野欧美视频 | 九色网址| 777奇米色| 黄色a级免费 | 日本大乳奶做爰 | 欧美hdse| 香蕉精品视频在线观看 | 欧美中文字幕在线视频 | 18禁超污无遮挡无码免费游戏 | 天堂伊人网 | 亚洲欧美天堂 | 日本a级黄色 | 农村寡妇一区二区三区 | 日韩免费av一区 | 日本午夜在线视频 | 日韩精品av一区二区三区 | 精品国产一区二区三区久久狼黑人 | 男女搞黄网站 | 超碰人人超 | 久久久久久久久久一级 | 奇米影视第4色 | 自慰无码一区二区三区 | 免费黄网站在线 | 中文字幕一区二区三区门四区五区 | 四虎永久网址 | 蜜桃一区二区 | av成人| www奇米影视com | 999精品 |