Squid做反向加速,配合DNS轮询实现简单负载均衡典型配置

编译squid的时候最少要加上 --disable-internal-dns编译选项,否则将不能使用。

[root@it800 /]# more /usr/local/squid/etc/squid.conf
http_port  192.168.33.10:800
icp_port 0
hierarchy_stoplist cgi-bin ?

acl QUERY urlpath_regex cgi-bin /?
no_cache deny QUERY

cache_mem 48 MB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /usr/local/squid/var/cache 100 16 256
emulate_httpd_log on
log_ip_on_direct on
hosts_file /etc/hosts

auth_param basic children 5
auth_param basic credentialsttl 2 hours
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320

acl all src 0.0.0.0/0.0.0.0
#acl localhost src 127.0.0.1/255.255.255.255
#acl to_localhost dst 127.0.0.0/8
acl accPort     port 800
acl accProto    proto HTTP FTP
acl accHostA     dstdomain .dxjy.org
acl accHostB    dstdomain .it800.biz
#http_access allow localhost all to_localhost
#http_access allow myNet toMyNet

http_access allow accProto accPort accHost
http_access allow accProto accPort accHostB
#http_reply_access allow all
#http_access allow all
http_access deny all

cache_effective_user    squid
cache_effective_group   squid
#visible_hostname www.it800.biz
httpd_accel_host 127.0.0.1
#httpd_accel_host 192.168.33.12
#httpd_accel_host c.it800.biz
httpd_accel_port 800
httpd_accel_single_host on
httpd_accel_with_proxy off
httpd_accel_uses_host_header on

error_directory /usr/local/squid/share/errors/Simplify_Chinese
uri_whitespace strip

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

#支持mrtg流量统计
acl snmppublic snmp_community public
snmp_port 3401
snmp_access allow snmppublic all

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值