• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

Squid代理设置

发布: 2007-7-04 12:06 | 作者: admin | 来源:  网友评论 | 查看: 13次 | 进入软件测试论坛讨论

领测软件测试网

配置文件:/etc/squid/squid.conf 

端口: 3128(默认,可更改)

1、配置/etc/squid/squid.conf文件:

    1)http_port:---设置端口

         http_port ip:port  (ip可不要) 如:http_port 3128  、 http_port 192.168.1.1:3128  这两个配置一样;

     2)visible_hostname:

         visible_hostname  ip(或主机域名)  如:visible_hostname 192.168.1.1   、visible_hostname proxy.test.com

     3)cache_mgr  --设置信息发给谁

          cache_mgr  root    or             cache_mgr  [email protected]

      4)cache_dir  --设置 cache存放目录:

          cache_dir ufs /var/spool/squid 100 16 256   每个100M 第一个级(/var/spool/squid目录下)有16个目录,而16个目录下每个有256个目录;

       5)cache_log    /cache_store_log

           cache_log /var/log/squid/cache.log

           cache_store_log /var/log/squid/store.log

       6)ACL 访问列表

            acl  name (任意起)  acl_type    条件

            acl_type :  src /srcdomain

                            dst/dstdomain

                            url_regex

                            time

                            proxy_auth

                            port

                            proto

                            maxconn        (如 acl conlist maxconn 10 ----表示使用同一个IP地址使用代理服务器的连接最多为10个)

            如:  

              设置源机器:     acl  computerdepart      src  192.168.8.0/255.255.255.0

                                      acl   company              srcdomain    .test.com

              设置目的机器:   acl    iplist                 dst   202.96.209.0 /255.255.255.0

                                      acl     urllist               dstdomain   .sina.com.cn  .sohu.com

                                     若目的域名太多可以将这些域名写成一个文件放到一个地方(如/etc/squid/dstdomainlist),

                                     然后设置 acl urllist dstdomain "/etc/squid/dstdomainlist"即可;

              设置访问时间:  acl   acc_time  time MTWHFAS  9:00-17:30                                     MTWHFAS   ---代表星期一到星期天

              设置端口:       acl  portlist  port  80  25

              设置协议:       acl  prolist   proto  HTTP FTP SMTP HTTPS

              设置关键字:   acl key-word   url_regex  sex job  game

                

               设置了以上访问列表后,可通过http_access allow (deny)来进行控制;另外多个访问列表可写在一个http_access项中,实现复合控制;

                http_access  allow acc_time

                http_access  allow computerdepart

                http_access  deny all

                以上设置本意是设置computerdepart部门的人能在acc_time规定的时间上网,但通过以上设置不能实现前面的要求,要更改为以下设置才能实现:

                http_access allow computerdepart acc_time

                 http_access deny all

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

              

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网