嫁入豪门幸福吗例子:高效配置Linux代理服务器 Squid介绍--4

来源:百度文库 编辑:中财网 时间:2024/05/13 23:55:24

1.配置squid.conf

http_port 80

cache_mem 32 MB

cache_swap_low 90

cache_swap_high 95

maximum_object_size 4096 KB

cache_dir /var/spool/squid 100 16 256

cache_access_log /var/log/squid/access.log

cache_log /var/log/squid/cache.log

cache_store_log /var/log/squid/store.log

cache_dns_program /usr/lib/squid/dnsserver

dns_nameservers 192.168.2.32

unlinkd_program /usr/lib/squid/unlinkd

acl all src 0.0.0.0/0.0.0.0

acl allow_ip src 192.168.2.1/255.255.255.0

acl manager proto cache_object

acl localhost src 192.168.2.32/255.255.255.255

acl SSL_ports port 443 563

acl Safe_ports port 80 21 443 563 70 210 1025-65535

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 localhost

http_access allow allow_ip

cache_effective_user squid

cache_effective_group squid

下面两个选项是用来定义squid加速模式的。用virtual来指定为虚拟主机模式。80端口为要加速的请求端口。采用这种模式时,Squid就取消了缓存及ICP功能,假如需要这些功能,必须设置httpd_accel_with_proxy选项。

httpd_accel_host virtual

httpd_accel_port 80