亚洲韩日午夜视频,欧美日韩在线精品一区二区三区,韩国超清无码一区二区三区,亚洲国产成人影院播放,久草新在线,在线看片AV色

您好,歡迎來到思海網(wǎng)絡(luò),我們將竭誠為您提供優(yōu)質(zhì)的服務(wù)! 誠征網(wǎng)絡(luò)推廣 | 網(wǎng)站備案 | 幫助中心 | 軟件下載 | 購買流程 | 付款方式 | 聯(lián)系我們 [ 會(huì)員登錄/注冊(cè) ]
促銷推廣
客服中心
業(yè)務(wù)咨詢
有事點(diǎn)擊這里…  531199185
有事點(diǎn)擊這里…  61352289
點(diǎn)擊這里給我發(fā)消息  81721488
有事點(diǎn)擊這里…  376585780
有事點(diǎn)擊這里…  872642803
有事點(diǎn)擊這里…  459248018
有事點(diǎn)擊這里…  61352288
有事點(diǎn)擊這里…  380791050
技術(shù)支持
有事點(diǎn)擊這里…  714236853
有事點(diǎn)擊這里…  719304487
有事點(diǎn)擊這里…  1208894568
有事點(diǎn)擊這里…  61352289
在線客服
有事點(diǎn)擊這里…  531199185
有事點(diǎn)擊這里…  61352288
有事點(diǎn)擊這里…  983054746
有事點(diǎn)擊這里…  893984210
當(dāng)前位置:首頁 >> 技術(shù)文章 >> 文章瀏覽
技術(shù)文章

Nginx+Squid+Apache2

添加時(shí)間:2011-3-26  添加: admin 

--enable-storeio=ufs,null //使用的文件系統(tǒng)通常是默認(rèn)的ufs,不過如果想要做一個(gè)不緩存任何文件的代理服務(wù)器,就需要加上null文件系統(tǒng)。

--enable-underscore //允許解析的URL中出現(xiàn)下劃先,因?yàn)槟J(rèn)squid會(huì)認(rèn)為帶下劃線的URL地址是非法的,并拒絕訪問該地址。

#make && make install

# /usr/local/squid/sbin/squid -z //測試Squid運(yùn)行狀況

# chown -R squid.squid /usr/local/squid/var/

修改squid配置文件

#vim /usr/local/squid/etc/squid.conf

#########一些訪問控制的設(shè)置##############

acl manager proto cache_object

acl localhost src 127.0.0.1/32

acl to_localhost dst 127.0.0.0/8

acl localnet src 10.0.0.0/8 # RFC1918 possible internal network

acl localnet src 172.16.0.0/12 # RFC1918 possible internal network

acl localnet src 192.168.0.0/16 # RFC1918 possible internal network

acl SSL_ports port 443

acl Safe_ports port 80 # http

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

http_access allow all

http_access allow localnet

http_access allow manager localhost

http_access deny manager

http_access deny !Safe_ports

http_access deny CONNECT !SSL_ports

icp_access allow localnet

icp_access deny all

htcp_access allow localnet

htcp_access deny all

##### 配置 squid2、squid3 為其鄰居,當(dāng) squid1 在其緩存中沒有找到請(qǐng)求的資源時(shí),通過 ICP 查詢?nèi)テ溧従又腥〉镁彺?###########

cache_peer s2.test.com sibling 80 3130

cache_peer s3.test.com sibling 80 3130

#### 將pic.test.com 域的請(qǐng)求通過 RR 輪詢方式轉(zhuǎn)發(fā)到apache節(jié)點(diǎn)############

squid1 的父節(jié)點(diǎn),originserver 參數(shù)指明是源服務(wù)器, round-robin 參數(shù)指明 squid 通過輪詢方式將請(qǐng)求分發(fā)到其中一臺(tái)父節(jié)點(diǎn); squid 同時(shí)會(huì)對(duì)這些父節(jié)點(diǎn)的健康狀態(tài)進(jìn)行檢查,如果父節(jié)點(diǎn) down 了,那么 squid 會(huì)從剩余的 origin 服務(wù)器中抓取數(shù)據(jù).我們這里只有一個(gè)節(jié)點(diǎn).

cache_peer 192.168.128.136 parent 80 0 no-query originserver round-robin name=web1

cache_peer_domain web1 pic.test.com

hierarchy_stoplist cgi-bin

####### 對(duì) squid 的一些優(yōu)化 ###############

maximum_object_size_in_memory 1024 KB //內(nèi)存中緩存的最大對(duì)象 1024KB

maximum_object_size 10240 KB // 能緩存的最大對(duì)象為 10M

cache_mem 64 MB //squid 用于緩存的內(nèi)存量

#####日志和緩存目錄的設(shè)置###########

access_log /usr/local/squid/var/logs/access.log squid

cache_log /usr/local/squid/var/logs/cache.log

refresh_pattern ^ftp: 1440 20% 10080

refresh_pattern ^gopher: 1440 0% 1440

refresh_pattern (cgi-bin|\?) 0 0% 0

refresh_pattern . 0 20% 4320

cache_effective_user squid

cache_effective_group squid

######### 設(shè)定 squid 的主機(jī)名 , 如無此項(xiàng) squid 將無法啟動(dòng)

visible_hostname s1.test.com

############# 配置 squid 為加速模式 #################

http_port 80 accel vhost vport

icp_port 3130

coredump_dir /usr/local/squid/var/cache

在hosts添加如下行.讓squid能找到其鄰居.

#cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

::1 localhost6.localdomain6 localhost6

192.168.128.137 s2.test.com

192.168.128.139 s3.test.com

其他兩臺(tái)squid配置跟其一致.只要修改上面標(biāo)明顏色的地方和/etc/hosts文件即可.

Squid開機(jī)自動(dòng)啟動(dòng)的實(shí)現(xiàn):

# vim /etc/init.d/squid

#!/bin/sh

#chkconfig: 35 85 15

#deion: squid

#function: use this to stop,start,restart squid....

#author:hsf

squid_BIN=/usr/local/squid/sbin/squid

squid_CONF=/usr/local/squid/etc/squid.conf

squid_PID=/usr/local/squid/var/logs/squid.pid

squid_PORT=`/bin/netstat -ntpl |grep squid |grep 80 |wc -l`

case $1 in

start)

if [ $squid_PORT = 0 ];then

echo "staring squid..."

$squid_BIN

else echo "starting squid failed,Address already in use..."

exit 2

fi

;;

stop)

echo "stoping squid..."

if [ -f $squid_PID ];then

kill -QUIT `cat $squid_PID`

else echo "squid is no running...."

fi

;;

status)

if [ -f $squid_PID ];then

echo "squid is running..."

else echo "squid is stop..."

fi

;;

restart)

if [ -f $squid_PID ];then

kill -HUP `cat $squid_PID`

else echo "squid is no running...."

fi

;;

*)

echo "Usage: $0 {start|stop|status|restart}"

exit 1

;;

esac

Apache安裝(192.168.128.136)

見apache安裝配置文檔.
 


關(guān)鍵字:關(guān)鍵字:Nginx Squid Apache

分享到:

頂部 】 【 關(guān)閉
版權(quán)所有:佛山思海電腦網(wǎng)絡(luò)有限公司 ©1998-2024 All Rights Reserved.
聯(lián)系電話:(0757)22630313、22633833
中華人民共和國增值電信業(yè)務(wù)經(jīng)營許可證: 粵B1.B2-20030321 備案號(hào):粵B2-20030321-1
網(wǎng)站公安備案編號(hào):44060602000007 交互式欄目專項(xiàng)備案編號(hào):200303DD003  
察察 工商 網(wǎng)安 舉報(bào)有獎(jiǎng)  警警  手機(jī)打開網(wǎng)站