锘??xml version="1.0" encoding="utf-8" standalone="yes"?>狠狠色丁香久久婷婷综合五月,国产99久久久国产精品~~牛,亚洲午夜久久久久久噜噜噜http://www.shnenglu.com/larryliuqing/category/18446.html鍏變韓浠婂ぉCode Sky, 鍏卞垱鏄庡ぉCode Sky!zh-cnTue, 03 Jan 2012 04:22:20 GMTTue, 03 Jan 2012 04:22:20 GMT60銆愯漿銆憇quid綆浠?/title><link>http://www.shnenglu.com/larryliuqing/archive/2012/01/03/163474.html</link><dc:creator>鍒樿繙娓?/dc:creator><author>鍒樿繙娓?/author><pubDate>Tue, 03 Jan 2012 03:54:00 GMT</pubDate><guid>http://www.shnenglu.com/larryliuqing/archive/2012/01/03/163474.html</guid><wfw:comment>http://www.shnenglu.com/larryliuqing/comments/163474.html</wfw:comment><comments>http://www.shnenglu.com/larryliuqing/archive/2012/01/03/163474.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/larryliuqing/comments/commentRss/163474.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/larryliuqing/services/trackbacks/163474.html</trackback:ping><description><![CDATA[<div style="color: #333333; font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 16px; line-height: 18px; font-weight: bold; height: 48px; padding-left: 30px; padding-top: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; border-image: initial; overflow-x: hidden; overflow-y: hidden; text-align: -webkit-left; ">squid綆浠?/div><div style="color: #999999; font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; line-height: 18px; margin-top: 5px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; text-align: -webkit-left; ">2008騫?2鏈?1鏃?鏄熸湡鍥?14:16</div><table style="table-layout: fixed; font-family: Arial; width: 958px; "><tbody><tr><td style="word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; color: #333333; "><div class="ztbfdph" id="blog_text" style="color: #666666; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 14px; line-height: 30px; background-image: url(http://imgsrc.baidu.com/css/pic/item/8334ad430aed590772f05d38.jpg); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-bottom: 80px; overflow-x: hidden; overflow-y: hidden; position: relative !important; border-image: initial; background-position: 100% 100%; background-repeat: no-repeat no-repeat; "><p style="line-height: normal; "><a name="top" style="text-decoration: none; color: rgb(81, 191, 224); "></a><a style="text-decoration: none; color: #4d4d4d; ">綆浠?/a><br /><a style="text-decoration: none; color: #4d4d4d; ">鏅氫唬鐞?/a><br /><a style="text-decoration: none; color: #4d4d4d; ">閫忔槑浠g悊</a><br /><a style="text-decoration: none; color: #4d4d4d; ">鍙嶅悜浠g悊</a><br /><a style="text-decoration: none; color: #4d4d4d; ">鏁呴殰澶勭悊</a><br /><a style="text-decoration: none; color: #4d4d4d; ">涓涓寖渚?/a><br /><a style="text-decoration: none; color: #4d4d4d; ">涓涓檺鍒惰闂殑鑼冧緥</a></p><p style="line-height: normal; ">瀹樻柟緗戠珯錛歨ttp://www.squid-cache.org/</p><p style="line-height: normal; ">鐩稿叧鎶鏈綉绔欙細http://www.visolve.com/</p><h2><a name="intro" style="text-decoration: none; color: rgb(81, 191, 224); "></a>涓. 浠g悊鏈嶅姟綆浠?/h2><a style="text-decoration: none; color: #4d4d4d; line-height: normal; ">榪斿洖</a><h3>1. 浠涔堟槸浠g悊鏈嶅姟鍣?Proxy Server)</h3><p style="line-height: normal; ">     浠g悊鏈嶅姟鍙互浠h〃鍏跺畠璁$畻鏈轟紶閫掓暟鎹寘鎴栦俊鎭?榪欎簺鏁版嵁鍖呭拰淇℃伅鍖呮嫭緗戦〉銆佺數瀛愰偖浠躲佸濯掍綋鏂囦歡鍜屽叾瀹冪綉緇滃簲鐢ㄧ▼搴忕瓑銆傞氳繃瀹冪殑鏂囦歡緙撳瓨鍜岃闂帶鍒剁瓑鍔熻兘錛屽彲浠ュ疄鐜板揩閫熸祻瑙堝拰瀵圭敤鎴瘋闂殑鏈夋晥綆$悊銆?/p><p style="line-height: normal; ">     Web浠g悊鏈嶅姟鍣?閫氬父鎵璇寸殑浠g悊鏈嶅姟鍣?鏄粙浜庢祻瑙堝櫒鍜學eb鏈嶅姟鍣ㄤ箣闂寸殑涓鍙版湇鍔″櫒,褰撲綘閫氳繃浠g悊鏈嶅姟鍣ㄤ笂緗戞祻瑙堟椂錛屾祻瑙堝櫒涓嶆槸鐩存帴鍒癢eb鏈嶅姟鍣ㄥ幓鍙栧洖緗戦〉鑰屾槸鍚戜唬鐞嗘湇鍔″櫒鍙戝嚭璇鋒眰錛岀敱浠g悊鏈嶅姟鍣ㄦ潵鍙栧洖嫻忚鍣ㄦ墍闇瑕佺殑淇℃伅騫朵紶閫佺粰浣犵殑嫻忚鍣ㄣ?鑰屼笖錛屽ぇ閮ㄥ垎浠g悊鏈嶅姟鍣ㄩ兘鍏鋒湁緙撳啿鐨勫姛鑳斤紝灝卞ソ璞′竴涓ぇ鐨凜ache錛屽畠鏈夊緢澶х殑瀛樺偍絀洪棿錛屽畠涓嶆柇灝嗘柊鍙栧緱鏁版嵁鍌ㄥ瓨鍒板畠鏈満鐨勫瓨鍌ㄥ櫒涓婏紝濡傛灉嫻忚鍣ㄦ墍璇鋒眰鐨勬暟鎹湪瀹冩湰鏈虹殑瀛樺偍鍣ㄤ笂宸茬粡瀛樺湪鑰屼笖鏄渶鏂扮殑錛岄偅涔堝畠灝變笉閲嶆柊浠嶹eb鏈嶅姟鍣ㄥ彇鏁版嵁錛岃岀洿鎺ュ皢瀛樺偍鍣ㄤ笂鐨勬暟鎹紶閫佺粰鐢ㄦ埛鐨勬祻瑙堝櫒錛岃繖鏍峰氨鑳芥樉钁楁彁楂樻祻瑙堥熷害鍜屾晥鐜囥?/p><p style="line-height: normal; ">銆鏇撮噸瑕佺殑鏄細浠g悊鏈嶅姟鍣ㄦ槸 Internet閾捐礬綰х綉鍏蟲墍鎻愪緵鐨勪竴縐嶉噸瑕佺殑瀹夊叏鍔熻兘錛屽畠鐨勫伐浣滀富瑕佸湪寮鏀劇郴緇熶簰鑱?(OSI) 妯″瀷鐨勫璇濆眰銆備富瑕佺殑鍔熻兘鏈夛細<br />銆銆 <br />銆銆1銆佽繛鎺nternet涓嶪ntranet 鍏呭綋firewall錛堥槻鐏錛夛細鍥犱負鎵鏈夊唴閮ㄧ綉鐨勭敤鎴烽氳繃浠g悊鏈嶅姟鍣ㄨ闂鐣屾椂錛屽彧鏄犲皠涓轟竴涓狪P鍦板潃錛屾墍浠ュ鐣屼笉鑳界洿鎺ヨ闂埌鍐呴儴緗戯紱鍚屾椂鍙互璁劇疆 IP鍦板潃榪囨護錛岄檺鍒跺唴閮ㄧ綉瀵瑰閮ㄧ殑璁塊棶鏉冮檺錛涘彟澶栵紝涓や釜娌℃湁浜掕仈鐨勫唴閮ㄧ綉錛屼篃鍙互閫氳繃絎笁鏂圭殑浠g悊鏈嶅姟鍣ㄨ繘琛屼簰鑱旀潵浜ゆ崲淇℃伅銆?/p><p style="line-height: normal; ">銆銆2銆佸叡浜洜鐗圭綉榪炴帴錛岃妭鐪両P寮閿錛氬鍓嶉潰鎵璁詫紝鎵鏈夌敤鎴峰澶栧彧鍗犵敤涓涓狪P錛屾墍浠ヤ笉蹇呯鐢ㄨ繃澶氱殑IP鍦板潃錛岄檷浣庣綉緇滅殑緇存姢鎴愭湰銆傝繖鏍鳳紝灞鍩熷眬鍐呮病鏈変笌澶栫綉鐩歌繛鐨勪紬澶氭満鍣ㄥ氨鍙互閫氳繃鍐呯綉鐨勪竴鍙頒唬鐞嗘湇鍔″櫒榪炴帴鍒板緗戯紝澶уぇ鍑忓皯璐圭敤銆傚綋鐒朵篃鏈夊畠涓嶅埄鐨勪竴闈紝濡傝澶氱綉緇滈粦瀹㈤氳繃榪欑鏂規硶闅愯棌鑷繁鐨勭湡瀹濱P鍦板潃錛岃岄冭繃鐩戣銆?/p><p style="line-height: normal; ">銆銆3銆佹彁楂樿闂熷害錛岃妭綰﹂氫俊甯﹀銆傝屼笖閫氬父浠g悊鏈嶅姟鍣ㄩ兘璁劇疆涓涓緝澶х殑紜洏緙撳啿鍖猴紙鍙兘楂樿揪鍑犱釜GB鎴栨洿澶э級錛屽綋鏈夊鐣岀殑淇℃伅閫氳繃鏃訛紝鍚屾椂涔熷皢鍏朵繚瀛樺埌緙撳啿鍖轟腑錛屽綋鍏朵粬鐢ㄦ埛鍐嶈闂浉鍚岀殑淇℃伅鏃訛紝鍒欑洿鎺ョ敱緙撳啿鍖轟腑鍙栧嚭淇℃伅錛屼紶緇欑敤鎴鳳紝浠庤岃揪鍒版彁楂樿闂熷害鐨勭洰鐨勩?/p><h3>2. 浠g悊鏈嶅姟鍣ㄧ殑紜歡闇姹?/h3><p style="line-height: normal; ">浠g悊鏈嶅姟鍣ㄥ浜庣‖浠剁殑瑕佹眰鐩稿綋鐨勯珮錛佸洜涓烘垜浠灦璁句唬鐞嗘湇鍔″櫒鐨勭洰鐨勫氨鏄笇鏈涜兘澶熷姞蹇綉緇滅殑浼犺緭閫熷害鍥犳錛岃櫧鐒朵唬鐞嗘湇鍔″櫒鍑犱箮鍦ㄤ換浣曠殑 Linux 緋葷粺涓婇潰閮借兘璺戯紝浣嗘槸浠g悊鏈嶅姟鍣ㄦ渶濂借繕鏄湁杈冮珮鐨勭‖浠墮厤緗細</p><p style="line-height: normal; ">CPU 瓚沖濂斤紱</p><p style="line-height: normal; ">RAM 瓚沖澶э紝榪欎篃鏄緢閲嶈鐨勪竴涓‖浠跺弬鏁?/p><p style="line-height: normal; ">Hard Disk 鏈濂借兘鐢?SCSI 鎺ュ彛鐨勶紝鍥犱負閫熷害涓庣ǔ瀹氬害閮芥瘮杈冨ソ錛佸鏋滀笉鑳界殑璇濓紝閭d箞 IDE 鎺ュ彛鐨勭‖鐩樼敱浜庣洰鍓嶉熷害涔熻秺鏉ヨ秺蹇紝鎵浠ヤ嬌鐢?IDE 涔熸病鏈夐棶棰橈紝浣嗘槸鏈濂芥槸銆庡鍧楃‖鐩樸忕殑鏋舵瀯錛屼緥濡傛垜鎬誨叡闇瑕?30 GB 鐨勭‖鐩樼┖闂達紝閭d箞鏈濂芥槸 10 GB 鐨勭‖鐩樹笁鍧楄繖鏍風殑鏋舵瀯杈冧匠銆?鏈濂藉湪鏋惰浠g悊鏈嶅姟鍣ㄦ椂錛屽皢鏁翠綋涓繪満鐨勮鍒掑仛濂斤紝騫朵笖璁╀唬鐞嗘湇鍔″櫒涓繪満鐨勬湇鍔″崟綰竴鐐癸紝鏈濂藉彧璐熻矗浠g悊鏈嶅姟</p><p style="line-height: normal; ">姣忛紜洏鐨勫閲忎笉闇瑕佸お澶э紝姝ゅ錛屾渶濂藉皢紜洏鍒嗗壊涓涓嬶紝涓涓垎鍖哄湪 2~4 GB 涔嬮棿鍗沖彲錛屽洜涓哄垎澶ぇ鐨勮瘽璧勬枡鐨勬悳瀵昏楄垂鏃墮棿杈冮暱錛屼絾鏄垎鍖哄お灝忓張鍙兘閫犳垚絀洪棿鐨勬氮璐?/p><p style="line-height: normal; ">cache 鏄斁緗湪鏌愪釜鐩綍涓嬬殑錛岃屾渶濂戒竴涓洰褰曞簳涓嬪氨鏄嫭绔嬬殑涓涓猵artition 銆傛澶栵紝鐢變簬 cache 鎵鍦ㄧ殑紜洏甯稿父浼氭湁璧勬枡鐨勫瓨鍙栵紝鍥犳鍙兘姝や竴紜洏鐨勬崯鑰楃巼浼氭瘮杈冨ぇ錛屾墍浠ヨ繖涓?cache 鎵鍦ㄧ殑紜洏鏈濂戒笉瑕佽窡閲嶈鏁版嵁鏂囦歡錛屼緥濡?/錛?/etc錛?/usr錛?/home 絳夌瓑閲嶈鐨勭郴緇熸枃浠舵斁鍦ㄤ竴璧鳳紒</p><p style="line-height: normal; ">涔熺敱浜?cache 鎵鍦ㄧ殑紜洏璧勬枡瀛樺彇澶瘑闆嗕簡錛屾墍浠ワ紝紜洏鐨勯夋嫨涓婇潰闇瑕?(1)杞熶笉鑳藉お浣庯紱 (2)紓佸ご鐨勬満姊拌噦闇瑕佸彲浠ュ繊鍙楅綣佺殑鍔ㄤ綔錛?3)鍙戠儹閲忎笉鍙お澶э紝鎴栬呭彲浠ヨ冭檻鍔犺紜洏鐢ㄩ鎵囥?/p><p style="line-height: normal; ">緗戠粶鍗′笌緗戠粶鍛ㄨ竟鏈濂戒嬌鐢?GBytes 鐨勭綉緇滃崱</p><h3>3. 浣跨敤squid鐨勫ソ澶?/h3><p style="line-height: normal; ">squid鏄紑婧愯蔣浠訛紝鎬ц兘浼樼銆傚茍浠嶅湪涓栫晫鍚勫湴鐨剆quid寮鍙戣呯殑鍏卞悓鍔姏涓嬶紝涓嶆柇鍙戝睍銆?/p><p style="line-height: normal; ">蹇熷搷搴旓紝鍑忓皯緗戠粶闃誨,Squid灝嗚繙紼婭nternet瀵硅薄淇濆瓨涓烘湰鍦版嫹璐濄傚綋鏈湴鐢ㄦ埛鍐嶆璁塊棶榪欎簺瀵硅薄鏃訛紝Squid鍙互鐩存帴蹇熷湴鎻愪緵瀵硅繖浜涘璞$殑璁塊棶錛岃屼笉蹇呭啀嬈″崰鐢ㄥ甫瀹借闂繙紼嬫湇鍔″櫒涓婄殑瀵硅薄銆?/p><p style="line-height: normal; ">澧炲己璁塊棶鎺у埗錛屾彁楂樺畨鍏ㄦс傚彲浠ラ拡瀵圭壒瀹氱殑鐨勭綉绔欍佺敤鎴楓佺綉緇溿佹暟鎹被鍨嬪疄鏂借闂帶鍒?/p><p style="line-height: normal; ">squid鍙互宸ヤ綔鍦ㄦ櫘閫氫唬鐞嗘ā寮忋侀忔槑浠g悊妯″紡鍚勫弽鍚戜唬鐞嗘ā寮?/p><h3>4. squid鐨勭粨鏋?/h3><p style="line-height: normal; ">澶氫釜squid浠g悊鏈嶅姟鍣ㄥ彲浠ラ氳繃icp鍗忚鐩鎬簰娌熼氾紝褰㈡垚鏍戝艦灞傛鍏崇郴錛堢埗浠g悊銆佸厔寮熶唬鐞嗐佸瓙浠g悊錛夛紝鏋勫緩浠g悊鏈嶅姟鍣ㄧ兢銆?/p><h2><a name="conf" style="text-decoration: none; color: rgb(81, 191, 224); "></a>浜? squid.conf鐨勫吀鍨嬮厤緗紙鏅氫唬鐞嗭級</h2><p style="line-height: normal; "><a style="text-decoration: none; color: #4d4d4d; ">榪斿洖</a></p><h3>1. 閰嶇疆</h3><p style="line-height: normal; ">#vi /etc/squid/squid.conf</p><p style="line-height: normal; ">#http_port鎸囦護鍛婅瘔squid鍦ㄥ摢涓鍙d睛鍚琀TTP璇鋒眰銆傞粯璁ょ鍙f槸3128,闄や笅闈㈢殑褰㈠紡澶?涔熷彲浠ユ槸http_port 192.168.63.50:3128<br />http_port 3128<br />icp_port 3130</p><p style="line-height: normal; ">#緙撳瓨鐩綍鐨勮緗?鍙互璁劇疆澶氫釜緙撳瓨鐩綍,璇硶涓?<cache_dir> <aufs|ufs> <鐩綍鎵鍦?gt; <MBytes澶у皬> <dir1> <dir2><br />cache_dir ufs /var/spool/squid 1000 64 1024</p><p style="line-height: normal; ">#涓嬮潰鏄叧浜庢棩蹇楁枃浠剁殑鏀劇疆鐩綍涓庢枃浠跺悕錛?br />cache_access_log /var/log/squid/access.log<br />cache_log /var/log/squid/cache.log<br />cache_store_log /var/log/squid/store.log<br />pid_filename /var/run/squid.pid</p><p style="line-height: normal; ">#鍏抽棴璁よ瘉鏈哄埗錛屾湁浜涚増鏈殑銆squid 浼氳嚜鍔ㄧ殑鍔犲叆浠g悊璁よ瘉鏈哄埗錛岃屾櫘閫氭儏鍐典笅鏄笉闇瑕佺殑,鏁呮壘鍒板寘鎷琣uth_param鐨勮錛岀粰瀹冧滑鍔犱笂娉ㄩ噴<br />#auth_param basic children 5<br />#auth_param basic realm Squid proxy-caching web server<br />#auth_param basic credentialsttl 2 hours</p><p style="line-height: normal; ">#璁劇疆squid鐢ㄦ埛鍙婄敤鎴風粍銆佺鐞嗗憳璐﹀彿<br />cache_effective_user squid<br />cache_effective_group squid <br />cache_mgr youraccount@your.e.mail</p><p style="line-height: normal; "># 涓庡唴瀛樻湁鍏崇殑閰嶇疆錛氬洜涓烘垜鐨勭郴緇熷唴瀛樺緢灝忥紝鎵浠ュ彧緇?8 MB錛佸鏋滄偍鐨勭墿鐞嗗唴瀛樺緢澶х殑鎯呭喌涓嬶紝渚嬪 512 MB錛屽彲浠ヨ冭檻鍔犲ぇ鍒?64 鎴?128 MB銆?br />cache_mem 128 MB</p><p style="line-height: normal; "># 涓庣鐩樺閲忔湁鍏崇殑閰嶇疆(娉細涓嬪垪鐨?90 涓?95 鏄櫨鍒嗘瘮 )錛屽鏋滄偍鐨?cache_dir 鎵鍦ㄧ鐩樺緢澶ф椂錛屽彲浠ヨ冭檻灝?4096 鏀規垚 32768 KB<br />cache_swap_low 90<br />cache_swap_high 95<br />maximum_object_size 4096 KB</p><p style="line-height: normal; "># 涓庡唴瀛樹繚瀛樿祫鏂欐湁鍏崇殑閰嶇疆<br />maximum_object_size_in_memory 8 KB</p><p style="line-height: normal; ">#瀹氫箟acl(璁塊棶鎺у埗鍒楄〃), 璇硶涓?acl<acl> <acl鍚嶇О> <acl綾誨瀷> <閰嶇疆鐨勫唴瀹?gt;<br />#榛戜綋涓虹敤鎴瘋嚜瀹氫箟閮ㄥ垎</p><p style="line-height: normal; ">acl All src 0/0 <br />acl Manager proto cache_object <br />acl Localhost src 127.0.0.1/32 <br />acl Safe_ports port 80 21 443 563 70 210 280 488 591 777 1025-65535 <br />acl SSL_ports 443 563 <br />acl CONNECT method CONNECT <br /><strong>acl MyNetwork src 192.168.0.0/16</strong><br /><br />#鍒╃敤鍓嶉潰瀹氫箟鐨刟cl,瀹氫箟璁塊棶鎺у埗瑙勫垯<br />http_access allow Manager Localhost<br />http_access deny Manager<br />http_access deny !Safe_ports<br />http_access deny CONNECT !SSL_ports<br /><strong>http_access allow MyNetwork</strong><br />http_access deny All</p><p style="line-height: normal; ">#瀹氫箟涓庡叾瀹冧唬鐞嗘湇鍔″櫒鐨勫叧緋?璇硶: <cache_peer> <涓繪満鍚嶇О> <綾誨埆> <http_port> <icp_port> <鍏跺畠鍙傛暟><br />cache_peer 192.168.60.6 parent 4480 7 no-query default</p><p style="line-height: normal; ">#璁劇疆涓庡叾瀹冧唬鐞嗘湇鍔″櫒鐨勫叧緋?<br /># <cache_peer_access> <涓婂眰 Proxy > <allow|deny> <acl鍚嶇О><br />#cache_peer_access 192.168.60.6 allow aclxxx <br />#cache_peer_access 192.168.60.6 deny !aclxxx</p><p style="line-height: normal; ">coredump_dir /var/spool/squid</p><h3>2. 嬋媧籹quid</h3><p style="line-height: normal; ">1). 鍦ㄥ紑鍚痵quid涔嬪墠錛屼綘搴旇楠岃瘉鍏墮厤緗枃浠舵槸鍚︽紜傝繍琛屽涓嬪懡浠ゅ嵆鍙細</p><p style="line-height: normal; "># squid -k parse</p><p style="line-height: normal; ">鍋囧浣犵湅涓嶅埌杈撳嚭錛岄厤緗枃浠舵湁鏁堬紝浣犺兘緇х畫鍚庨潰鐨勬楠ゃ傜劧鑰岋紝濡傛灉閰嶇疆鏂囦歡鍖呭惈閿欒錛宻quid浼氬憡璇変綘錛?/p><p style="line-height: normal; ">2). 鍒濆鍖朿ache鐩綍.鍗沖緩绔嬬紦瀛樼洰褰曠殑瀛樺偍鏍煎紡</p><p style="line-height: normal; ">鍙渶鍦ㄧ涓嬈″惎鍔╯quid鏈嶅姟涔嬪墠鎵ц(鍦ㄥ垵嬈¤繍琛宻quid涔嬪墠錛屾垨鑰呮棤璁轟綍鏃朵綘澧炲姞浜嗘柊鐨刢ache_dir錛屼綘蹇呴』鍒濆鍖朿ache鐩綍銆?</p><p style="line-height: normal; "># squid -z</p><p style="line-height: normal; ">cache鐩綍鍒濆鍖栧彲鑳借姳璐逛竴浜涙椂闂達紝渚濊禆浜巆ache鐩綍鐨勫ぇ灝忓拰鏁伴噺錛屼互鍙婄鐩橀┍鍔ㄥ櫒鐨勯熷害銆傚亣濡備綘鎯寵瀵熻繖涓繃紼嬶紝璇蜂嬌鐢?X閫夐」錛?/p><p style="line-height: normal; "># squid -zX</p><p style="line-height: normal; ">3). 鍚姩squid鏈嶅姟</p><p style="line-height: normal; "># service squid start</p><p style="line-height: normal; ">鍋囧畾squid瀹夎鍦?usr/local/squid鐩綍涓?涔熷彲浠?/p><p style="line-height: normal; "># /usr/local/squid/sbin/squid -sD</p><p style="line-height: normal; ">4). 鍋滄squid</p><p style="line-height: normal; ">鏈瀹夊叏鐨勫仠姝quid鐨勬柟娉曟槸浣跨敤squid -k shutdown鍛戒護錛?/p><p style="line-height: normal; "># squid -k shutdown</p><p style="line-height: normal; ">5). 閲嶉厤緗繍琛屼腑鐨剆quid榪涚▼</p><p style="line-height: normal; ">鍦ㄤ綘浜嗚В浜嗘洿澶氬叧浜巗quid鐨勭煡璇嗗悗錛屼綘浼氬彂鐜板squid.conf鏂囦歡鍋氫簡璁稿鏀瑰姩銆備負浜嗚鏂拌緗敓鏁堬紝浣犲彲浠ュ叧闂拰閲嶅惎squid,鎴栬呭湪squid榪愯鏃訛紝閲嶉厤緗畠銆?/p><p style="line-height: normal; ">閲嶉厤緗繍琛屼腑鐨剆quid鏈濂界殑鏂規硶鏄嬌鐢╯quid -k reconfigure鍛戒護錛?/p><p style="line-height: normal; "># squid -k reconfigure</p><p style="line-height: normal; ">6). 婊氬姩鏃ュ織鏂囦歡</p><p style="line-height: normal; ">闄ら潪浣犲湪squid.conf閲岀姝紝squid浼氬啓澶ч噺鐨勬棩蹇楁枃浠躲備綘蹇呴』鍛ㄦ湡鎬х殑婊氬姩鏃ュ織鏂囦歡錛屼互闃繪瀹冧滑鍙樺緱澶ぇ銆俿quid灝嗗ぇ閲忕殑閲嶈淇℃伅鍐欏叆鏃ュ織錛屽亣濡傚啓涓嶈繘鍘諱簡錛宻quid浼氬彂鐢熼敊璇茍閫鍑恒備負浜嗗悎鐞嗘帶鍒剁鐩樼┖闂存秷鑰楋紝鍦╟ron閲屼嬌鐢ㄥ涓嬪懡浠わ細</p><p style="line-height: normal; ">%squid -k rotate</p><p style="line-height: normal; ">渚嬪錛屽涓嬩換鍔℃帴鍙e湪姣忓ぉ鐨勬棭涓?鐐規粴鍔ㄦ棩蹇楋細</p><p style="line-height: normal; ">0 4 * * * /usr/local/squid/sbin/squid -k rotate</p><p style="line-height: normal; ">璇ュ懡浠ゅ仛涓や歡浜嬨傞鍏堬紝瀹冨叧闂綋鍓嶆墦寮鐨勬棩蹇楁枃浠躲傜劧鍚庯紝閫氳繃鍦ㄦ枃浠跺悕鍚庡姞鏁板瓧鎵╁睍鍚嶏紝瀹冮噸鍛藉悕cache.log,store.log,鍜?access.log銆備緥濡傦紝cache.log鍙樻垚cache.log.0,cache.log.0鍙樻垚cache.log.1,濡傛緇х畫錛屾粴鍔ㄥ埌 logfile_rotate閫夐」鎸囧畾鐨勫箋?/p><p style="line-height: normal; ">squid浠呬粎淇濆瓨姣忎釜鏃ュ織鏂囦歡鐨勬渶鍚巐ogfile_rotate鐗堟湰銆傛洿鑰佺殑鐗堟湰鍦ㄩ噸鍛藉悕榪囩▼涓鍒犻櫎銆傚亣濡備綘鎯充繚瀛樻洿澶氱殑鎷瘋礉錛屼綘闇瑕佸鍔爈ogfile_rotate闄愬埗錛屾垨鑰呯紪鍐欒剼鏈敤浜庡皢鏃ュ織鏂囦歡縐誨姩鍒板叾浠栦綅緗?璇瘋13.7绔犲叧浜庢粴鍔ㄦ棩蹇楃殑鍏朵粬淇℃伅銆?/p><h3>3. 璁塊棶鎺у埗紺轟緥</h3><p style="line-height: normal; ">1) 紱佹璁塊棶鏌愪釜緗戠珯</p><p style="line-height: normal; ">鍦╯quid閰嶇疆鏂囦歡涓坊鍔犱互涓媋cl鍚嶇О鍙婅闂鍒?騫墮噸鏂板姞杞介厤緗枃浠?/p><p style="line-height: normal; ">acl sina dstdomain .sina.com.cn .sina.com<br />http_access deny sina</p><p style="line-height: normal; ">鎴?/p><p style="line-height: normal; ">acl sina dst 58.63.236.26 58.63.236.27 58.63.236.28 58.63.236.29 58.63.236.30 58.63.236.31 58.63.236.32 58.63.236.33 58.63.236.34 58.63.236.35 58.63.236.36 58.63.236.37 58.63.236.38 58.63.236.39 58.63.236.49 58.63.236.50<br />http_access deny sina</p><p style="line-height: normal; ">鎴?/p><p style="line-height: normal; ">acl sina dst www.sina.com.cn<br />http_access deny sina</p><p style="line-height: normal; ">2) 紱佹鏉ヨ嚜鏌愪簺IP鍦板潃鐨勮闂?/p><p style="line-height: normal; ">鍦╯quid閰嶇疆鏂囦歡涓坊鍔犱互涓媋cl鍚嶇О鍙婅闂鍒?騫墮噸鏂板姞杞介厤緗枃浠?/p><p style="line-height: normal; ">acl zhang src 192.168.63.6/32<br />http_access deny zhang</p><p style="line-height: normal; ">3) 紱佹鍦ㄦ煇浜涙椂孌佃闂?/p><p style="line-height: normal; ">acl Working_hours MTWHF 08:00-17:00<br />http_access allow Working_hours<br />http_access deny !Working_hours</p>4) 紱佹鏌愪釜浠g悊瀹㈡埛寤虹珛榪囧榪炴帴<p style="line-height: normal; ">acl OverConnLimit maxconn 4 <br />http_access deny OverConnLimit</p><h2><a name="transconf" style="text-decoration: none; color: rgb(81, 191, 224); "></a>涓? 閫忔槑浠g悊</h2><p style="line-height: normal; "><a style="text-decoration: none; color: #4d4d4d; ">榪斿洖</a></p><p style="line-height: normal; ">璁╂垜浠幇鍦ㄦ潵鎯寵薄涓涓仈鏈虹姸鎬侊紝灝辨槸浣犳湁涓鏁寸粍鍐呴儴緗戠粶錛岃岃繖涓唴閮ㄧ綉緇滈兘鏄忚繃 NAT 涓繪満鑱旀満鍑哄幓鐨勩傞偅涔堟垜浠皥榪囷紝灝辨槸鍦ㄤ竴涓唴閮ㄧ綉寰堝ぇ鐨勬儏鍐典笅錛屼嬌鐢?Proxy 鏄竴涓緢涓嶉敊鐨勯夋嫨錛屽洜涓鴻嚦灝戜粬鍙互鍑忚交甯﹀璐熻嵎錛佷笉榪囷紝閬楁喚鐨勬槸錛屾灦璁?Proxy 鐨勬椂鍊欙紝涔熻浣跨敤鑰呭湪嫻忚鍣ㄤ笂闈㈣緗唬鐞嗭紒閭d箞鏈夋病鏈夊姙娉曞湪銆庝嬌鐢ㄨ呬笉闇瑕佸湪嫻忚鍣ㄤ笂闈㈣繘琛屼換浣曢厤緗紝灝卞彲浠ュ疄鐜頒互 Proxy 甯姪浣跨敤鑰呰仈鎺nternet錛熷綋鐒舵湁鍟︼紒閭e氨鏄?Transparent Proxy 鍟︼紒涔熸湁浜虹炕璇戞垚銆庨忔槑浠g悊鏈嶅姟鍣ㄣ忥紝鍏跺師鐞嗘槸錛?/p><p style="line-height: normal; ">褰撲嬌鐢ㄨ呯粡榪?NAT 鏈嶅姟鍣ㄦ潵鑱旀満榪涘叆 Internet 鏃訛紝鍋囧浣跨敤鐨?Internet 鍗忚涓?80 (涔熷氨鏄?WWW) 錛岄偅涔堝氨灝嗚繖涓姹備氦緇?Proxy 鏉ュ伐浣滐紝浠ヨ揪鍒頒唬鐞嗘湇鍔″櫒鐨勫姛鑳姐?/p><p style="line-height: normal; "><br />鍛靛懙錛佷篃灝辨槸璇達紝褰撲嬌鐢ㄨ呮槸緇忚繃 NAT 涓繪満鑱旀満鍑哄幓鏃訛紝鍙璁?NAT 涓繪満鍙戠幇銆庡挦錛佷綘鏄鍘昏鍙?www 鐨勮祫鏂欏鍚э紒濂斤紒閭d箞榪欎釜鍔ㄤ綔鐢?Proxy 涓繪満甯綘鎼炲畾錛併忓姝や竴鏉ワ紝浣跨敤鑰呮牴鏈氨涓嶉渶瑕佸湪嫻忚鍣ㄤ笂闈㈤厤緗?Proxy 鐨勭浉鍏寵祫鏂欙紝鍥犱負榪欎釜鍔ㄤ綔鏄庣敱 NAT 涓繪満鑷繁鍐沖畾鐨勩忥紝鎵浠ュ彧瑕佸湪 NAT 涓繪満涓婇潰閰嶇疆濡ュ綋鍗沖彲錛屼嬌鐢ㄨ呬笉蹇呴厤緗換浣曡祫鏂欏憿錛侀偅涔堣鎬庝箞榪涜鍛紵鍙涓や釜姝ラ鍗沖彲錛?/p><h3>1. 閰嶇疆 Proxy 涓繪満錛?/h3><p style="line-height: normal; ">1) 濡傛灉鏄痵quid 2.5,闇瑕佹洿鏀箂quid閰嶇疆鏂囦歡涓殑涓嬪垪鎸囦護:</p><p style="line-height: normal; ">[root@test root]# vi /etc/squid/squid.conf <br />錛?nbsp;<br />httpd_accel_host virtual # 鍛婅瘔web鍔犻熷櫒,閽堝鎵鏈夌殑URL</p><p style="line-height: normal; ">httpd_accel_port 80 # 鍛婅瘔web鍔犻熷櫒錛岃鐩戝惉鐨勭鍙f槸80錛?/p><p style="line-height: normal; ">httpd_accel_with_proxy on # 榪欎釜寰堥噸瑕侊紒鍥犱負閰嶇疆 httpd_accel_host 涔嬪悗錛?cache 鐨勯厤緗細鑷姩琚粓姝紝蹇呴』瑕佸姞涓婅繖涓厤緗負 on 涔嬪悗錛屾墠鑳芥彁渚?cache 鐨勫姛鑳斤紒<br />httpd_accel_uses_host_header on</p><p style="line-height: normal; ">2) 濡傛灉鏄痵quid 2.6,鍒欏彧闇瑕佹洿鏀箂quid閰嶇疆鏂囦歡涓殑涓涓寚浠?</p><p style="line-height: normal; ">http_port 192.168.63.50:3128 transparent #192.168.63.50 灝辨槸squid鏈嶅姟鍣ㄧ殑鍦板潃</p><p style="line-height: normal; ">[root@test root]# squid -k reconfigure</p><h3>2. 閰嶇疆 NAT 涓繪満鐨?port map 錛?/h3><p style="line-height: normal; ">鍐嶆潵璁╂垜浠埌 NAT 涓繪満涓婇潰鐪嬬湅鍏堬紝鍥犱負闇瑕佸皢 80 榪欎釜 port 浜ょ粰 Proxy 鐨?3128 鏉ュ府蹇欏崗鍔╋紝鎵浠ヤ綘鐨勯槻鐏 script 蹇呴』瑕佸姞鍏ヨ繖涓孌墊墠琛岋細銆</p><p style="line-height: normal; ">#iptables -t nat -A PREROUTING -i eth0 -p tcp -s 192.168.62.0/24 --dport 80 -j REDIRECT --to-ports 3128</p><p style="line-height: normal; ">娉ㄦ剰涓涓嬶紝閭d釜 eth0 鏄庝綘鐨?NAT 瀵瑰唴鐨勭綉鍗°忥紝鑷充簬 192.168.62.0/24 鍒欐槸浣犵殑鍐呴儴緗戝煙錛岃渚濈収浣犵殑涓繪満瀹為檯鐘舵佹潵閰嶇疆錛佽繖鏍蜂竴鏉ワ紝鎮ㄧ殑 client 绔畬鍏ㄤ笉闇瑕佽繘琛屼換浣曠殑閰嶇疆錛岀珛鍒誨氨鍙互浣跨敤 Proxy 鐨勫ソ澶勫暟</p><h3>3. 閰嶇疆杞彂</h3><p style="line-height: normal; ">#echo 1 > /proc/sys/net/ipv4/ip_forward</p><p style="line-height: normal; ">鎴栵細</p><p style="line-height: normal; ">#vi /etc/sysctl.conf</p><p style="line-height: normal; ">net_ipv4_forword=1</p><p style="line-height: normal; ">#vi /etc/sysconfig/network</p><p style="line-height: normal; ">FORWARD_IPV4=yes</p><p style="line-height: normal; ">#service network restart</p><h3>4. 閰嶇疆瀹㈡埛绔?/h3><p style="line-height: normal; ">灝嗗彟澶栦竴鍙拌綆楁満浣滀負瀹㈡埛鏈鴻繘琛屾祴璇曪紝闇瑕佸皢緗戝叧銆侀閫塂NS鏈嶅姟鍣ㄦ寚鍚戣緗忔槑浠g悊鐨勬湇鍔″櫒錛屾竻闄ゅ鎴風鐨勬祻瑙堝櫒浠g悊璁劇疆銆?/p><h2><a name="reverseconf" style="text-decoration: none; color: rgb(81, 191, 224); "></a>鍥? 鍙嶅悜浠g悊</h2><p style="line-height: normal; "><a style="text-decoration: none; color: #4d4d4d; ">榪斿洖</a></p><p style="line-height: normal; ">浠g悊鏈嶅姟鍣ㄦ槸浣跨敤闈炲父鏅亶鐨勪竴縐嶅皢灞鍩熺綉涓繪満鑱斿叆浜掕仈緗戠殑涓縐嶆柟寮忥紝浣跨敤浠g悊涓婄綉鍙互鑺傜害绱х己鐨処P鍦板潃璧勬簮錛岃屼笖鍙互闃繪柇澶栭儴涓繪満瀵瑰唴閮ㄤ富鏈虹殑璁塊棶錛屼嬌鍐呴儴緗戜富鏈哄厤鍙楀閮ㄧ綉涓繪満鐨勬敾鍑匯備絾鏄紝濡傛灉鎯寵浜掕仈緗戜笂鐨勪富鏈鴻闂唴閮ㄧ綉鐨勪富鏈鴻祫婧愶紙渚嬪錛歐eb绔欑偣錛夛紝鍙堟兂浣垮唴閮ㄧ綉涓繪満鍏嶅彈澶栭儴緗戜富鏈烘敾鍑伙紝涓鑸殑浠g悊鏈嶅姟鏄笉鑳藉疄鐜扮殑錛岄渶瑕佷嬌鐢ㄥ弽鍚戜唬鐞嗘潵瀹炵幇銆?/p><p style="line-height: normal; ">浠涔堟槸鍙嶅悜浠g悊鍛紵鍏跺疄錛屽弽鍚戜唬鐞嗕篃灝辨槸閫氬父鎵璇寸殑WEB鏈嶅姟鍣ㄥ姞閫燂紝瀹冩槸涓縐嶉氳繃鍦ㄧ箒蹇欑殑WEB鏈嶅姟鍣ㄥ拰Internet涔嬮棿澧炲姞涓涓珮閫熺殑WEB緙撳啿鏈嶅姟鍣紙鍗籌細WEB鍙嶅悜浠g悊鏈嶅姟鍣級鏉ラ檷浣庡疄闄呯殑WEB鏈嶅姟鍣ㄧ殑璐熻澆銆傚吀鍨嬬殑緇撴瀯濡備笅鍥炬墍紺猴細</p><p style="line-height: normal; ">Web鏈嶅姟鍣ㄥ姞閫燂紙鍙嶅悜浠g悊錛夋槸閽堝Web鏈嶅姟鍣ㄦ彁渚涘姞閫熷姛鑳界殑銆傚畠浣滀負浠g悊Cache錛屼絾騫朵笉閽堝嫻忚鍣ㄧ敤鎴鳳紝鑰岄拡瀵逛竴鍙版垨澶氬彴鐗瑰畾Web鏈嶅姟鍣紙榪欎篃鏄弽鍚戜唬鐞嗗悕縐扮殑鐢辨潵錛夈傚疄鏂藉弽鍚戜唬鐞嗭紙濡備笂鍥炬墍紺猴級錛屽彧瑕佸皢Reverse Proxy Cache璁懼鏀劇疆鍦ㄤ竴鍙版垨澶氬彴Web鏈嶅姟鍣ㄥ墠绔嵆鍙傚綋浜掕仈緗戠敤鎴瘋闂煇涓猈EB鏈嶅姟鍣ㄦ椂錛岄氳繃DNS鏈嶅姟鍣ㄨВ鏋愬悗鐨処P鍦板潃鏄疪everse Proxy Server鐨処P鍦板潃,鑰岄潪鍘熷Web鏈嶅姟鍣ㄧ殑IP鍦板潃,榪欐椂Reverse Proxy Server璁懼鍏呭綋Web鏈嶅姟鍣紝嫻忚鍣ㄥ彲浠ヤ笌瀹冭繛鎺ワ紝鏃犻渶鍐嶇洿鎺ヤ笌Web鏈嶅姟鍣ㄧ浉榪炪傚洜姝わ紝澶ч噺Web鏈嶅姟宸ヤ綔閲忚鍗歌澆鍒板弽鍚戜唬鐞嗘湇鍔′笂銆備笉浣嗚兘澶熼槻姝㈠閮ㄧ綉涓繪満鐩存帴鍜寃eb鏈嶅姟鍣ㄧ洿鎺ラ氫俊甯︽潵鐨勫畨鍏ㄩ殣鎮o紝鑰屼笖鑳藉寰堝ぇ紼嬪害涓婂噺杞粀eb鏈嶅姟鍣ㄧ殑璐熸媴錛屾彁楂樿闂熷害銆?/p><p style="line-height: normal; ">1錛?Squid鍙嶅悜浠g悊鍗曚釜鍚庡彴WEB鏈嶅姟鍣?/p><p style="line-height: normal; "><span style="font-size: 9pt; "><img height="260" src="http://www.linux.gov.cn/netweb/images/reverse_typical.gif" width="230" border="0" alt="" /></span></p><p style="line-height: normal; ">1) 濡傛灉WEB鏈嶅姟鍣ㄥ拰鍙嶅悜浠g悊鏈嶅姟鍣ㄦ槸涓ゅ彴鍗曠嫭鐨勬満鍣紙涓鑸殑鍙嶅悜浠g悊搴旇鏈変袱鍧楃綉鍗″垎鍒繛鎺ヤ簡鍐呭閮ㄧ綉緇滐級銆傞偅涔堬紝搴旇淇敼涓嬮潰鐨勫唴瀹規潵璁劇疆鍙嶅悜浠g悊鏈嶅姟銆?/p><p style="line-height: normal; ">http_port 80 #squid鐩戝惉鐨勭鍙?br />httpd_accel_host 172.16.250.250 #鍐呴儴WEB鏈嶅姟鍣ㄧ殑IP鍦板潃<br />httpd_accel_port 80 #WEB鏈嶅姟鐨勭鍙e彿<br />httpd_accel_single_host on #杞彂娌℃湁緙撳啿鐨勮姹傚埌涓鍙板崟鐙殑鏈哄櫒錛宻quid琚緗垚浠呭鍗曚竴鐨剋eb鏈嶅姟鍣ㄤ綔鍙嶅悜浠g悊<br />httpd_accel_with_proxy on #濡傛灉甯屾湜squid鏃綔鍙嶅悜浠g悊鏈嶅姟鍣ㄥ張浣滄湰鍦版満鍣ㄧ殑涓婄綉浠g悊錛岄渶瑕佸皢姝よ涓簅n錛岄粯璁ゆ槸off<br />httpd_accel_uses_host_header off銆#鍦℉TTP鍗忚1.1涓紝HTTP璇鋒眰鍖呮嫭涓涓富鏈哄ご淇℃伅錛屾寚瀹歎RL鐨勪富鏈哄悕鎴栬呬富鏈虹殑IP鍦板潃銆傝繖涓夐」鍙互鐢ㄦ潵瀹屾垚澶氫釜鍚庡彴WEB鏈嶅姟鍣ㄧ殑鍙嶅悜浠g悊鍔熻兘銆?/p><p style="line-height: normal; ">2) 濡傛灉WEB鏈嶅姟鍣ㄥ拰鍙嶅悜浠g悊鏈嶅姟鍣ㄦ槸鍚屼竴鍙版満鍣ㄣ傞偅涔堬紝搴旇璁劇疆WEB鏈嶅姟鍣ㄧ殑鐩戝惉绔彛涓洪潪80绔彛錛堟瘮濡傦細81绔彛錛夈傝淇敼鐨勫唴瀹瑰涓嬶細</p><p style="line-height: normal; ">http_port 80 #squid鐩戝惉鐨勭鍙?br />httpd_accel_host localhost #鍐呴儴WEB鏈嶅姟鍣ㄧ殑IP鍦板潃<br />httpd_accel_port 81 #WEB鏈嶅姟鍣ㄧ殑绔彛鍙?br />httpd_accel_single_host on<br />httpd_accel_with_proxy on <br />httpd_accel_uses_host_header off</p><p style="line-height: normal; ">2錛嶴quid鍙嶅悜浠g悊澶氫釜鍚庡彴WEB鏈嶅姟鍣?/p><p style="line-height: normal; ">鎴戜滑鍙互鐢⊿quid鍙嶅悜浠g悊澶氫釜鍚庡彴WEB鏈嶅姟鍣ㄣ備緥濡傦細鎴戜滑鍙互閰嶇疆squid鍚屾椂鍙嶅悜浠g悊www.abc.com, www.xyz.com, www.lmn.com涓変釜鍚庡彴WEB鏈嶅姟鍣紝紺烘剰鍥懼涓嬶細</p><p style="line-height: normal; "><span style="font-size: 9pt; "><img height="260" src="http://www.linux.gov.cn/netweb/images/reverse_mult.gif" width="230" border="0" alt="" /></span></p><p style="line-height: normal; ">Squid鐨勯厤緗涓嬶細</p><p style="line-height: normal; ">httpd_accel_host virtual<br />httpd_accel_port 80 <br />httpd_accel_single_host off <br />httpd_accel_uses_host_header on</p><p style="line-height: normal; ">錛堟敞鎰?緙栬瘧Squid鏃墮渶嬋媧籌nternal DNS閫夐」錛?/p><p style="line-height: normal; ">鐒跺悗璁劇疆璁劇疆鍙嶅搷浠g悊闇瑕佺殑鍩熷悕瑙f瀽錛圛nternet鐢ㄦ埛閫氳繃榪欓噷瑙f瀽涓変釜緗戠珯鐨勫煙鍚嶏級濡備笅錛?/p><p style="line-height: normal; ">www.abc.com 202.102.240.74<br />www.xyz.com 202.102.240.74<br />www.lmn.com 202.102.240.74</p><p style="line-height: normal; ">浣夸笁涓煙鍚嶉兘鎸囧悜鍙嶅悜浠g悊鏈嶅姟鍣ㄧ殑IP鍦板潃202.102.240.74銆?/p><p style="line-height: normal; ">涓嬮潰璁劇疆鍙嶅悜浠g悊鎵闇瑕佺殑DNS鍏ュ彛淇℃伅錛堝嵆璁劇疆鍐呴儴DNS錛屼粎浠呮槸squid鍦ㄥ唴閮ㄤ嬌鐢紝Internet鐢ㄦ埛涓嶅彲瑙侊級銆傛湁涓ょ鏂規硶鍙互璁劇疆鍐呴儴DNS錛屼嬌鐢ㄥ唴閮―NS鏈嶅姟鍣ㄦ潵瑙f瀽鎴栬呬嬌鐢?etc/hosts鏂囦歡鏉ュ疄鐜般?/p><p style="line-height: normal; ">浣跨敤鍐呴儴DNS鏈嶅姟鍣ㄧ殑璧勬簮璁板綍濡備笅錛?br />www.abc.com IN A 192.168.62.2<br />www.xyz.com IN A 192.168.62.3<br />www.lmn.com IN A 192.168.62.4</p><p style="line-height: normal; ">濡傛灉浣跨敤/etc/hosts鏂囦歡鏉ュ疄鐜板唴閮―NS錛堢紪璇戞椂搴斾嬌鐢╠isable internal dns閫夐」錛?緙栬緫/etc/hosts鏂囦歡娣誨姞濡備笅鏉$洰錛?nbsp;<br />192.168.62.2 www.abc.com<br />192.168.62.3 www.xyz.com<br />192.168.62.4 www.lmn.com</p><p style="line-height: normal; ">緇撹錛氶氳繃鏈枃涓殑璁鴻堪鍜岀浉鍏沖疄渚嬶紝鍙互鐪嬪嚭錛屽弽鍚戜唬鐞嗘柟寮忎笉鍗曟槸涓縐峎EB鏈嶅姟鍣ㄥ姞閫熷櫒錛岃屼笖浣夸篃涓縐嶅澶栨彁渚沇eb鍙戝竷鏃朵嬌鐢ㄧ殑鏈夋晥鐨勯槻鐏鎶鏈紝浣跨敤瀹冧笉浣嗚兘鑺傜害绱х己鐨処P鍦板潃璧勬簮錛屽姞閫焀EB鏈嶅姟鍣ㄧ殑璁塊棶閫熷害錛岃屼笖鑳藉淇濇姢WEB涓繪満錛屽洜姝よ兘澶熼傚簲澶氱搴旂敤鍦哄悎銆?/p><h2><a name="troubleshoot" style="text-decoration: none; color: rgb(81, 191, 224); "></a>浜? 鏁呴殰澶勭悊</h2><p style="line-height: normal; "><a style="text-decoration: none; color: #4d4d4d; ">榪斿洖</a></p><p style="line-height: normal; ">1. 濡傛灉鍦ㄥ惎鍔╯quid鏃跺嚭鐜頒笅榪頒俊鎭?</p><p style="line-height: normal; ">% squid -Nd1<br /><br />FATAL: Could not determine fully qualified hostname. Please set 'visible_hostname'</p><p style="line-height: normal; ">鍒欓渶瑕佸湪squid鐨勯厤緗枃浠朵腑璁劇疆visible_hostname,濡?</p><p style="line-height: normal; ">visible_hostname squid.packet-pushers.net</p><p style="line-height: normal; ">2. 濡傛灉鍦ㄩ厤緗畇quid浠g悊鍚?瀹㈡埛璁塊棶鍑虹幇浠ヤ笅鎻愮ず:</p><p style="line-height: normal; ">ERROR<br />The requested URL could not be retrieved</p><p style="line-height: normal; ">While trying to retrieve the URL: http://.../</p><p style="line-height: normal; ">鍙兘闇瑕佸湪squid閰嶇疆鏂囦歡涓姞鍏ヤ互涓嬫寚浠?</p><p style="line-height: normal; ">always_direct allow all</p><h2><a name="example1" style="text-decoration: none; color: rgb(81, 191, 224); "></a>鍏? 涓涓寖渚?/h2><p style="line-height: normal; "><a style="text-decoration: none; color: #4d4d4d; ">榪斿洖</a></p><p style="line-height: normal; ">http_port 3128<br />icp_port 0</p><p style="line-height: normal; ">cache_mem 64 MB<br />cache_swap_low 80<br />cache_swap_high 85</p><p style="line-height: normal; ">maximum_object_size 32000 KB</p><p style="line-height: normal; ">cache_dir ufs /var/spool/squid 500 64 1024<br />cache_access_log /var/log/squid/access.log<br />cache_log /var/log/squid/cache.log<br />cache_store_log /var/log/squid/store.log</p><p style="line-height: normal; ">pid_filename /var/run/squid.pid</p><p style="line-height: normal; ">acl all src 0.0.0.0/0.0.0.0<br />acl alldst dst 0.0.0.0/0.0.0.0<br />acl manager proto cache_object<br />acl localhost src 127.0.0.1/255.255.255.255<br />acl to_localhost dst 127.0.0.0/8<br />acl 163 url_regex 163.com<br />acl sina url_regex sina.com.cn<br />acl myclient src 192.168.6.0/24</p><p style="line-height: normal; ">http_access allow 163<br />http_access allow sina<br />http_access deny !sina<br />http_access deny !163</p><p style="line-height: normal; ">cache_peer 192.168.1.8 parent 8080 7 no-query default</p><p style="line-height: normal; ">cache_effective_user squid<br />cache_effective_group squid<br />cache_mgr root@net03.org<br />coredump_dir /var/spool/squid</p><h2><a name="example2" style="text-decoration: none; color: rgb(81, 191, 224); "></a>涓? 涓涓檺鍒惰闂殑鑼冧緥</h2><p style="line-height: normal; "><a style="text-decoration: none; color: #4d4d4d; ">榪斿洖</a></p><p style="line-height: normal; ">http_port 3128<br />icp_port 0<br />cache_mem 64 MB<br />cache_swap_low 80<br />cache_swap_high 85<br />maximum_object_size 32000 KB<br />cache_dir ufs /var/spool/squid 500 64 1024<br />cache_access_log /var/log/squid/access.log<br />cache_log /var/log/squid/cache.log<br />cache_store_log /var/log/squid/store.log<br />pid_filename /var/run/squid.pid<br />acl all src 0.0.0.0/0.0.0.0<br />acl manager proto cache_object<br />acl localhost src 127.0.0.1/255.255.255.255<br />acl to_localhost dst 127.0.0.0/8<br />acl SSL_ports port 443 563<br />acl Safe_ports port 80 # http<br />acl Safe_ports port 21 # ftp<br />acl Safe_ports port 443 563 # https, snews<br />acl Safe_ports port 70 # gopher<br />acl Safe_ports port 210 # wais<br />acl Safe_ports port 1025-65535 # unregistered ports<br />acl Safe_ports port 280 # http-mgmt<br />acl Safe_ports port 488 # gss-http<br />acl Safe_ports port 591 # filemaker<br />acl Safe_ports port 777 # multiling http<br />acl CONNECT method CONNECT<br />acl myclient src 192.168.6.0/24<br />acl 163 url_regex 163.com<br />acl sina url_regex sina.com.cn<br /># Only allow cachemgr access from localhost<br />http_access allow manager localhost<br />http_access deny manager<br /># Deny requests to unknown ports<br />http_access deny !Safe_ports<br /># Deny CONNECT to other than SSL ports<br />http_access deny CONNECT !SSL_ports</p><p style="line-height: normal; ">cache_peer 192.168.1.8 parent 8080 7 no-query default</p><p style="line-height: normal; ">acl ip_acl src 192.168.6.0/24<br />acl time_acl time M T W H F A S 9:00-19:00<br />http_access allow ip_acl time_acl</p><p style="line-height: normal; ">cache_peer_access 192.168.1.8 allow 163<br />cache_peer_access 192.168.1.8 deny !163<br />cache_peer_access 192.168.1.8 allow sina<br />cache_peer_access 192.168.1.8 deny !sina</p><p style="line-height: normal; ">cache_effective_user squid<br />cache_effective_group squid<br />cache_mgr root@net03.org<br />coredump_dir /var/spool/squid</p><p style="line-height: normal; ">#acl pl800_arp arp 00:08:c7:9f:34:41<br />#http_access allow pl800_arp</p></div></td></tr></tbody></table><img src ="http://www.shnenglu.com/larryliuqing/aggbug/163474.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/larryliuqing/" target="_blank">鍒樿繙娓?/a> 2012-01-03 11:54 <a href="http://www.shnenglu.com/larryliuqing/archive/2012/01/03/163474.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.nyvgcd.cn" target="_blank">国产99久久久久久免费看</a>| <a href="http://www.99341.cn" target="_blank">久久er99热精品一区二区</a>| <a href="http://www.lvtonggaoerfu.cn" target="_blank">国产成人无码精品久久久免费</a>| <a href="http://www.yunva.cn" target="_blank">久久精品国产99国产精品澳门</a>| <a href="http://www.jcfw-1.cn" target="_blank">日本一区精品久久久久影院</a>| <a href="http://www.su26.cn" target="_blank">久久天天躁狠狠躁夜夜不卡</a>| <a href="http://www.f-lover.cn" target="_blank">2021国产精品久久精品</a>| <a href="http://www.ulcc.com.cn" target="_blank">九九久久自然熟的香蕉图片</a>| <a href="http://www.amgtm.cn" target="_blank">国产精品欧美久久久久无广告 </a>| <a href="http://www.baidudianying.cn" target="_blank">中文字幕无码精品亚洲资源网久久</a>| <a href="http://www.uyns.cn" target="_blank">国内精品伊人久久久久777</a>| <a href="http://www.tianlaiedu.cn" target="_blank">久久精品国产亚洲AV香蕉</a>| <a href="http://www.qiaokuo.cn" target="_blank">99久久精品免费看国产</a>| <a href="http://www.jsfkf.cn" target="_blank">亚洲国产精品成人久久</a>| <a href="http://www.moonlong.cn" target="_blank">91久久精品电影</a>| <a href="http://www.matchweb.cn" target="_blank">亚洲AV无码久久精品狠狠爱浪潮</a>| <a href="http://www.gzmxjc.cn" target="_blank">国产精品丝袜久久久久久不卡</a>| <a href="http://www.ouseshi.cn" target="_blank">国产A三级久久精品</a>| <a href="http://www.9yyg.cn" target="_blank">国产精品一区二区久久精品无码 </a>| <a href="http://www.panxl.cn" target="_blank">99久久综合国产精品免费</a>| <a href="http://www.hg795.cn" target="_blank">国产欧美久久久精品</a>| <a href="http://www.jfhtgj.cn" target="_blank">久久热这里只有精品在线观看</a>| <a href="http://www.qqmuying.cn" target="_blank">色综合久久中文综合网</a>| <a href="http://www.tfy8.cn" target="_blank">久久久久久人妻无码</a>| <a href="http://www.ctoshop163.cn" target="_blank">久久久高清免费视频</a>| <a href="http://www.yutobe.cn" target="_blank">久久精品国产第一区二区</a>| <a href="http://www.5uatm.cn" target="_blank">国内精品伊人久久久久</a>| <a href="http://www.90key.cn" target="_blank">久久99热只有频精品8</a>| <a href="http://www.6105555.cn" target="_blank">亚洲AV乱码久久精品蜜桃</a>| <a href="http://www.jituansms.cn" target="_blank">亚洲伊人久久综合影院</a>| <a href="http://www.ylcq185.cn" target="_blank">久久婷婷五月综合97色直播</a>| <a href="http://www.k1822.cn" target="_blank">久久精品国产精品亚洲艾草网美妙</a>| <a href="http://www.studenthotel.cn" target="_blank">久久久久人妻一区二区三区vr</a>| <a href="http://www.bxxlsl.cn" target="_blank">亚洲AV无码久久寂寞少妇</a>| <a href="http://www.myjhy.cn" target="_blank">无码国内精品久久人妻</a>| <a href="http://www.ireboot.cn" target="_blank">亚洲香蕉网久久综合影视</a>| <a href="http://www.kxtravel.com.cn" target="_blank">久久青青色综合</a>| <a href="http://www.upboss.cn" target="_blank">国内高清久久久久久</a>| <a href="http://www.guangzb.cn" target="_blank">无码日韩人妻精品久久蜜桃</a>| <a href="http://www.macroshot.cn" target="_blank">无码人妻久久一区二区三区免费丨</a>| <a href="http://www.allevery.cn" target="_blank">久久午夜无码鲁丝片秋霞 </a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>