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

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

squid反向代理网站配置示例

發(fā)布時(shí)間:2025/3/15 编程问答 14 豆豆
生活随笔 收集整理的這篇文章主要介紹了 squid反向代理网站配置示例 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

squid編譯安裝參數(shù)?

  • ./configure?--prefix=/usr/local/squid?\?
  • --disable-carp?\?
  • --with-aufs-threads=32?\?
  • --with-pthreads?\?
  • --with-large-files?\?
  • --enable-storeio='ufs,aufs'?\?
  • --enable-disk-io='AIO,Blocking'?\?
  • --enable-removal-policies='heap,lru'?\?
  • --disable-wccp?\?
  • --enable-kill-parent-hack?\?
  • --enable-snmp?\?
  • --disable-poll?\?
  • --disable-select?\?
  • --disable-ipv6???\?
  • --enable-auth=basic?\?
  • --with-aio?\?
  • --disable-ident-lookup?\?
  • --enable-useragent-log?\?
  • --enable-referer-log???\?
  • --with-filedescriptors=65536?\?
  • --with-pidfile=/var/run/squid.pid?
  • 如果出現(xiàn)下面的錯(cuò)誤

  • configure:?error:?C++?compiler?cannot?create?executables?
  • See?`config.log'?for?more?details?
  • configure:?error:?./configure?failed?for?lib/libTrie?
  • 請安裝

  • yum?install?kdevelop?
  • yum?install?gcc-c++?
  • 安裝

  • #make?&&?make?install?
  • 初始化cache目錄

  • #?squid?-z?
  • squid.conf配置

  • http_port?80?accel?vhost?vport?
  • ?
  • logfile_rotate?10?
  • log_fqdn?off?
  • ?
  • cache_swap_low?90?
  • cache_swap_high?97?
  • cache_mem?10240?MB?
  • cache_mgr?Henry?
  • cachemgr_passwd?password?all?
  • ?
  • cache_effective_user?squid?
  • cache_effective_group?squid?
  • ?
  • coredump_dir?/usr/local/squid/var/cache?
  • cache_dir?ufs?/usr/local/squid/var/cache?51200?16?256?
  • ?
  • cache_replacement_policy?lru?
  • memory_replacement_policy?lru?
  • ?
  • cache_store_log?none?
  • cache_access_log?/usr/local/squid/var/logs/access.log?
  • cache_log?/usr/local/squid/var/logs/cache.log?
  • ?
  • fqdncache_size?1024?
  • mime_table?/usr/local/squid/etc/mime.conf?
  • error_directory?/usr/local/squid/share/errors/en-us/?
  • icon_directory??/usr/local/squid/share/icons/?
  • err_page_stylesheet?/usr/local/squid/etc/errorpage.css?
  • emulate_httpd_log?on?
  • max_open_disk_fds?0?
  • ?
  • maximum_object_size?50?MB?
  • minimum_object_size?0?KB?
  • maximum_object_size_in_memory?5120?KB?
  • ?
  • pipeline_prefetch?on?
  • forwarded_for?off?
  • forward_timeout?2?minutes?
  • client_lifetime?1?hours?
  • client_persistent_connections?off?
  • server_persistent_connections?on?
  • half_closed_clients?off?
  • httpd_suppress_version_string?on?
  • check_hostnames?off?
  • ?
  • visible_hostname?proxy.xxx.xxx
  • pid_filename?/var/run/squid.pid?
  • vary_ignore_expire?off?
  • negative_ttl?0?minutes?
  • ?
  • reply_header_access?Server?deny?all?
  • reply_header_access?X-Cache?deny?all?
  • reply_header_access?Warning?deny?all?
  • reply_header_access?Expires?deny?all?
  • reply_header_access?Cache-Control?deny?all?
  • reply_header_access?age?deny?all?
  • ?
  • acl?localhost?src?127.0.0.1/32?
  • acl?to_localhost?dst?127.0.0.0/8?0.0.0.0/32?
  • acl?manager?proto?cache_object?
  • ?
  • acl?SSL_ports?port?443?563?
  • acl?Safe_ports?port?80?#?http?
  • acl?Safe_ports?port?3130?#?icp?
  • acl?Safe_ports?port?21?#?ftp?
  • acl?Safe_ports?port?443?#?https?
  • acl?Safe_ports?port?70?#?gopher?
  • acl?Safe_ports?port?210?#?wais?
  • acl?Safe_ports?port?1025-65535?#?unregistered?ports?
  • acl?Safe_ports?port?280?#?http-mgmt?
  • acl?Safe_ports?port?488?#?gss-http?
  • acl?Safe_ports?port?591?#?filemaker?
  • acl?Safe_ports?port?777?#?multiling?http?
  • acl?CONNECT?method?CONNECT?
  • acl?PURGE?method?PURGE?
  • ?
  • icp_port?3130?
  • icp_hit_stale?off?
  • icp_access?allow?all?
  • ?
  • cache_peer?127.0.0.1?parent?8080?0?no-query?no-digest?no-netdb-exchange?originserver?name=a
  • cache_peer?127.0.0.1?parent?8080?0?no-query?no-digest?no-netdb-exchange?originserver?name=b
  • cache_peer?127.0.0.1?parent?8080?0?no-query?no-digest?no-netdb-exchange?originserver?name=c
  • ?
  • #cache_peer?192.168.1.160?sibling?3128?3130?name=cache01?
  • #cache_peer?192.168.1.130?sibling?80?3130?name=cache02?
  • #cache_peer?192.168.1.159?sibling?3128?3130?name=cache03?
  • ?
  • cache_peer_domain a xxx.xxx.xxx.xxx
  • cache_peer_domain b xxx.xxx.xxx.xxx?
  • cache_peer_domain c xxx.xxx.xxx.xxx
  • ?
  • cache_peer_access a allow?all?
  • cache_peer_access b allow?all?
  • cache_peer_access c allow?all?
  • ?
  • peer_connect_timeout?30?seconds?
  • request_timeout?1?minutes?
  • persistent_request_timeout?2?minutes?
  • ?
  • hierarchy_stoplist?-i?^https:\\???cgi-bin???
  • acl?QUERY?urlpath_regex?-i?cgi-bin?\??\.asp?\.php?\.jsp?\.cgi?Servlet?
  • acl?denyssl?urlpath_regex?-i?^https:\\?
  • no_cache?deny?QUERY?
  • no_cache?deny?denyssl?
  • #acl?broken302?http_status?400-404?302?
  • ?
  • http_access?allow?manager?localhost?
  • http_access?allow?PURGE?localhost?
  • http_access?deny?!Safe_ports?
  • http_access?deny?CONNECT?!SSL_ports?
  • #http_access?deny?broken302?
  • http_access?allow?localhost?all?
  • http_access?allow?all?
  • http_access?deny?all?
  • ?
  • #SNMP?with?Cacti?config?here?
  • snmp_port?3401?
  • acl?snmppublic?snmp_community?valesquid?
  • snmp_access?allow?snmppublic?localhost?
  • snmp_access?deny?all?
  • #snmp_incoming_address?0.0.0.0?
  • #snmp_outgoing_address?0.0.0.0?
  • ?
  • refresh_pattern?^ftp:???????????1440????20%?????10080?
  • refresh_pattern?^gopher:????????1440????0%??????1440?
  • refresh_pattern?-i?(/cgi-bin/|\?)?0?????0%??????0?
  • refresh_pattern?.???????????????0???????20%?????4320?
  • refresh_pattern?-i?\.jpg$???????1440????90%?????2880?
  • refresh_pattern?-i?\.gif$???????1440????90%?????2880?
  • refresh_pattern?-i?\.jpg$???????1440????50%?????2880?
  • refresh_pattern?-i?\.rar$???????1440????50%?????2880?
  • refresh_pattern?-i?\.zip$???????1440????50%?????2880?
  • refresh_pattern?-i?\.doc$???????1440????50%?????2880?
  • refresh_pattern?-i?\.ppt$???????1440????50%?????2880?
  • refresh_pattern?-i?\.js$????????60??????50%?????2880?
  • refresh_pattern?-i?\.css$???????60??????50%?????2880?
  • refresh_pattern?-i?\.html$??????60??????50%?????1440?
  • refresh_pattern?-i?\.txt$???????1440????50%?????2880?
  • 后端的apache虛擬主機(jī)部分

  • #?-----------------------------?
  • #?add?by?Henry?He?on?2011/04/11?
  • #?-----------------------------?
  • <VirtualHost?*:8080>?
  • ????ServerAdmin? xxx.xxx.xxx
  • ????ServerName?? xxx.xxx.xxx
  • ????ServerAlias? xxx.xxx.xxx?
  • ????DocumentRoot?"/var/www/xxxx"?
  • ????#ErrorLog?????"logs/xxx.xxx.xxx-error_log"?
  • ????#CustomLog????"logs/xxx.xxx.xxx-access_log"?combined?
  • </VirtualHost>?
  • ?
  • <VirtualHost?*:8080>?
  • ????ServerAdmin? xxx.xxx.xxx
  • ????ServerName? xxx.xxx.xxx
  • ????ServerAlias? xxx.xxx.xxx?
  • ????DocumentRoot?"/var/www/xxx.com"?
  • </VirtualHost>?
  • #?-----------------------?end??------------------------------?
  • PS:

    apache的log顯示ip來源都是127.0.0.1,修改配置文件使其可以正常記錄來訪IP

    修改前:

  • LogFormat?"%h?%l?%u?%t?\"%r\"?%>s?%b?\"%{Referer}i\"?\"%{User-Agent}i\""?combined?
  • 修改后

  • LogFormat?"%{X-Forwarded-For}i?%l?%u?%t?\"%r\"?%>s?%b?\"%{Referer}i\"?\"%{User-Agent}i\""?combined?
  • 快速清空cache

  • echo "" >?/usr/local/squid/var/cache/swap.state?
  • 對于類似http://xxx.xxx.xxx/default.html之類的網(wǎng)頁,squid只會生成一個(gè)緩存文件。可以用squid附帶的squidclient工具清除:

  • squidclient?-m?PURGE?-p?80?"http://xxx.xxx.xxx/default.html"?
  • squid命中率查看

  • squidclient?-p?80?-U?Henry?-W?xxxx?mgr:info?|grep?-i?hit?
  • ????????Hits?as?%?of?all?requests:??????5min:?62.1%,?60min:?64.1%?
  • ????????Hits?as?%?of?bytes?sent:????????5min:?63.4%,?60min:?60.6%?
  • ????????Memory?hits?as?%?of?hit?requests:???????5min:?97.3%,?60min:?89.7%?
  • ????????Disk?hits?as?%?of?hit?requests:?5min:?0.2%,?60min:?0.1%?
  • ????????Cache?Hits:????????????0.00000??0.00000?
  • ????????Near?Hits:?????????????0.00091??0.00091?
  • 內(nèi)存使用情況:

  • squidclient?-p?80?-U?Henry?-W?password?mgr:mem
  • 該指令可以看到在squid運(yùn)行過程中,有那些文件被squid緩存到內(nèi)存中,并返回給訪問用戶。

  • tail?-f?/usr/local/squid/var/logs/access.log?|grep?TCP_MEM_HIT?
  • 該指令可以看到在squid運(yùn)行過程中,有那些文件被squid緩存到cache目錄中,并返回給訪問用戶。
  • tail?-f?/usr/local/squid/var/logs/access.log?|grep?TCP_HIT??

  • 該指令可以看到在squid運(yùn)行過程中,有那些文件沒有被squid緩存,而是現(xiàn)重原始服務(wù)器獲取并返回給訪問用戶。

  • tail?-f?/usr/local/squid/var/logs/access.log?|grep?TCP_MISS?

  • 本文轉(zhuǎn)自dongfang_09859 51CTO博客,原文鏈接:http://blog.51cto.com/hellosa/550567,如需轉(zhuǎn)載請自行聯(lián)系原作者

    總結(jié)

    以上是生活随笔為你收集整理的squid反向代理网站配置示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

    主站蜘蛛池模板: aaa在线视频 | 天天综合久久综合 | 精品美女在线 | 日日艹夜夜艹 | 午夜片在线观看 | 婷婷在线观看视频 | 亚洲色图自拍 | 国产精品扒开腿做爽爽爽视频 | 亚洲高清免费 | 亚洲小说春色综合另类 | 九七影院在线观看免费观看电视 | 日日夜夜爱爱 | 国产精品69毛片高清亚洲 | 一区二区福利电影 | 亚洲福利网站 | 琪琪秋霞午夜被窝电影网 | 综合天堂av久久久久久久 | 王者后宫yin肉h文催眠 | 国产伦精品一区二区三区高清 | 热久久精 | 91高跟黑色丝袜呻吟在线观看 | 成年人91视频 | 亚洲精品久 | 欧美成人综合视频 | 久久人人爽人人爽人人片 | 成人传媒 | 欧美自拍视频在线观看 | 久久久久亚洲av片无码下载蜜桃 | 成人黄色激情小说 | 亚洲中文字幕无码一区二区三区 | 欧美一区二区三区精品 | 中文一二区 | 欧美色图网站 | 中文字幕永久在线观看 | 在线黄色av网站 | 久久九九爱 | 国产精品偷乱一区二区三区 | 日韩av不卡电影 | 国产3p视频| 最新最近中文字幕 | 精品一区二区三区免费视频 | 日日噜噜夜夜狠狠久久波多野 | 国产精品成人Av | 97碰碰视频| 污污视频在线看 | 97干视频| 日韩精品一区二区在线视频 | 亚洲影视在线 | 在线免费观看网站入口在哪 | 国产精品久久久久久久久久东京 | 久久蜜桃av一区二区天堂 | 中文字幕日韩在线视频 | 中文字幕日韩精品在线观看 | 密桃成熟时在线观看 | 成人综合在线观看 | 香蕉久久夜色精品国产使用方法 | 国产男女精品 | 爱爱爱免费视频 | 黄色片子免费看 | www一区二区 | 一区二区视频观看 | 中国在线观看视频高清免费 | 荫道bbwbbb高潮潮喷 | 91插插视频| 亚洲天堂最新 | 久久久精品人妻一区二区三区色秀 | 午夜激情电影在线观看 | 亚洲AV综合色区国产精品天天 | 亚洲精品亚洲人成人网 | 亚洲天堂五月 | 国产精品刘玥久久一区 | 精品国产乱码久久久久久浪潮 | 亚洲经典在线 | 亚洲成人影音 | 337p粉嫩大胆噜噜噜亚瑟影院 | 亚洲国产一区二区a毛片 | www.欧美com | 欧美人体一区二区 | 色综合色综合网色综合 | 久久久久久久久一区 | 欧美黄色图片 | 一区视频 | av地址在线| 伊人影院综合在线 | 99精品国产免费 | 影音先锋男人的天堂 | 国产a级黄色片 | 国产精品久久久久久久久久免费 | 一区二区国产电影 | 日韩美女激情视频 | 人妻在线日韩免费视频 | 久久久久久久久久影视 | 久热这里只有 | 播金莲一级淫片aaaaaaa | 久久久久久久久久久久国产 | 五月综合在线 | 成人精品影院 | 日本国产中文字幕 | 午夜精品久久久久久久久久久久久 |