¸ßÐÔÄÜ»º´æ·þÎñÆ÷Squid¼Ü¹¹ÅäÖÃ
Ç°ÑÔ* Ëæ×ÅÍøÕ¾·ÃÎÊÈËÊýÔ½À´Ô½¶à£¬³ÐÊܵIJ¢·¢ºÍѹÁ¦Ò²Ô½À´Ô½¸ß£¬ÕâʱºòÎÒÃÇÐèÒª¶ÔÍøÕ¾ºÍ¼Ü¹¹½øÐÐÓÅ»¯£¬½ñÌìÎÒÃÇÀ´ÌÖÂÛʹÓÃSquid¶Ô¼Ü¹¹½øÐÐÓÅ»¯£¬»º´æÍøÕ¾¡£ÍøÉ϶ÔsquidÃèÊöµÄÎÄÕÂÒ²ÓгÉǧÉÏÍò£¬ÎÒÕâÀï¼òµ¥¼Ç¼һÏÂʵ¼ùµÄ²½Öè¡£
ÔÎÄ£ºhttp://wgkgood.blog.51cto.com/1192594/1384580
1
2
3
|
ϵͳ°æ±¾£ºCentOSx86_64 5.8 Squid°æ±¾£ºsquid-2.6 Nginx°æ±¾£ºnginx-1.4.2 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#sysctl.conf config 2014-03-26 net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 net.ipv4.tcp_max_tw_buckets = 10000 net.ipv4.tcp_sack = 1 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_rmem = 4096 87380 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 net.core.wmem_default = 8388608 net.core.rmem_default = 8388608 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.core.netdev_max_backlog = 262144 net.core.somaxconn = 262144 net.ipv4.tcp_max_orphans = 3276800 net.ipv4.tcp_max_syn_backlog = 262144 net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_synack_retries = 1 net.ipv4.tcp_syn_retries = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_mem = 94500000 915000000 927000000 net.ipv4.tcp_fin_timeout = 1 net.ipv4.tcp_keepalive_time = 15 net.ipv4.ip_local_port_range = 1024 65535 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#!/bin/sh #Auto make install squid server #Author wugk 2014-03-26 SQUID_CNF= /etc/squid/squid .conf CACHE_DIR=( /data/cache1 /data/cache2 ) #Install squid shell yum install -y squid #config squid.conf cat >>$SQUID_CNF <<EOF #global config squid.conf 2014-03-26 http_port 80 accel vhost vport cache_peer 192.168.149.128 parent 80 0 originserver name=wugk1 cache_peer 192.168.149.129 parent 80 0 originserver name=wugk2 cache_peer_domain wugk1 www.wugk1.com cache_peer_domain wugk2 www.wugk2.com visible_hostname localhost forwarded_for off via off cache_vary on #acl config acl manager proto cache_object acl localhost src 127.0.0.1 /32 acl to_localhost dst 127.0.0.0 /8 0.0.0.0 /32 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 8080 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl all src 0.0.0.0 /0 acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localnet http_access allow localhost http_access allow all acl PURGE method PURGE http_access allow PURGE localhost http_access deny PURGE #squid config 2014-03-25 cache_dir aufs /data/cache1 10240 16 256 cache_dir aufs /data/cache2 10240 16 256 cache_mem 4000 MB maximum_object_size 8 MB maximum_object_size_in_memory 256 KB hierarchy_stoplist cgi-bin ? coredump_dir /var/spool/squid refresh_pattern ^ ftp : 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i ( /cgi-bin/ |\?) 0 0% 0 refresh_pattern \.(jpg|png|gif|mp3|xml|html|htm|css|js) 1440 50% 2880 ignore-reload refresh_pattern . 0 20% 4320 EOF #config cache_dir mkdir -p ${CACHE_DIR[@]} ; chown -R squid:squid ${CACHE_DIR[@]} #restart squid server /etc/init .d /squid restart if [ "$?" == "0" ]; then echo "The Squid Server Install Successfully !!" else echo "The Squid Server Install Failed !!,Please Check Log......" fi |
1
|
squidclient -p 80 mgr:info |egrep "(Request Hit Ratios|Byte Hit Ratios)" |
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ