Chinaunix首页 | 论坛 | 博客
  • 博客访问: 773448
  • 博文数量: 156
  • 博客积分: 5320
  • 博客等级: 大校
  • 技术积分: 1605
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-09 12:24
文章分类

全部博文(156)

文章存档

2010年(20)

2009年(46)

2008年(21)

2007年(21)

2006年(33)

2005年(10)

2004年(5)

分类: WINDOWS

2008-05-06 09:46:32

Squid for Windows
C:\>cd c:\squid\etc
C:\squid\etc>copy squid.conf.default squid.conf   
C:\squid\etc>copy mime.conf.default mime.conf     


c:\>cd c:\squid\sbin
C:\squid\sbin>squid -i    #注册squid服务
C:\squid\sbin>squid -z    #生成cache
C:\squid\sbin>squid  


C:\squid\etc>type squid.conf

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
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 manager localhost
http_access deny manager

http_access deny !Safe_ports

http_access allow all
icp_access allow all
http_port 192.168.1.18:3128


hierarchy_stoplist cgi-bin ?



access_log c:/squid/var/logs/access.log squid


refresh_pattern ^ftp:        1440    20%    10080
refresh_pattern ^gopher:    1440    0%    1440
refresh_pattern .        0    20%    4320


acl apache rep_header Server ^Apache
broken_vary_encoding allow apache



---------------------

Jan-13-2010 更新squid 只允许内网用户访问特定站点.

c:\squid\etc>type squid.conf

 

acl all src all
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 allow_domain dstdomain "/squid/etc/allow_domain"   #定义可以访问的站点信息

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.1.0/24 # RFC1918 possible internal network   #定义内网信息

acl mmxfile urlpath_regex \.mp3$ \.avi$ \.exe$ \.rm$                  #定义禁止下载的文件类型

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 manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access deny mmxfile                                   #禁止下载已定义的文件类型
#http_access allow localnet
http_access allow allow_domain                             #只可以访问已定义的站点信息
#http_access deny all

visible_hostname Hecny.SGN.office.Internet.Access.Control  #定义拒绝访问时的站点信息
cache_mgr                                  #定义拒绝访问时的站点联系人信息

icp_access allow localnet
icp_access deny all
http_port 3128                                             #端口号




c:\squid\etc>type allow_domain

.google.com
.google.com.vn
.google.vn
.google.cn
.baidu.com
.0101host.com
.50states.com

......

阅读(3478) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-05-29 13:55:55

13.2.4 影响access.log的配置指令 下列配置文件指令会影响到access.log。 13.2.4.1 log_icp_queries 该指令默认激活,导致squid记录所有的ICP查询。假如运行了一个繁忙的父cache,这点可能让access.log文件变得巨大。为了节省磁盘空间,可禁止该指令: log_icp_queries off