星期五, 九月 22, 2006

二维数组new小结

服务器软件:squid+客户端软件:proxycap
squid是一个带有缓存的web代理服务器。据说使用代理速度比直接联网还要快。proxycap是一个可以对不同程序指定不同代理,并且可以指定代理规则。它支持sock,http代理。

squid在linux下安装:
tar -zxvf squid-3.0-PRE3.tar.gz
./configure --prefix=/usr/local/squid
make all
make install
To run a Cache, you will need to:

1. customize the squid.conf configuration file:
vi /usr/local/squid/etc/squid.conf

    http_port 3128
    icp_port 0



    acl QUERY urlpath_regex cgi-bin \?
    no_cache deny QUERY

    cache_dir ufs /opt/web/bin/squid/var/cache 100 16 256

    access_log /opt/web/bin/squid/var/logs/access.log
    cache_log /opt/web/bin/squid/var/logs/cache.log

    emulate_httpd_log on
    dns_nameservers 202.112.80.106

    half_closed_clients off

    auth_param basic children 5
    auth_param basic realm Squid proxy-caching web server
    auth_param basic credentialsttl 2 hours


    ignore_unknown_nameservers on

    forwarded_for off
    log_icp_queries off

    client_persistent_connections on
    server_persistent_connections on

    client_db off

    hierarchy_stoplist cgi-bin ?
    hierarchy_stoplist -i ^https:\\ ?
    acl QUERY urlpath_regex -i cgi-bin \? \.asp \.php \.jsp \.cgi
    acl denyssl urlpath_regex -i ^https:\\
    no_cache deny QUERY
    no_cache deny denyssl


    cache_mgr zwj436@eyou.com
    cache_effective_user web

    visible_hostname wj.jianqing.net


    acl manager proto cache_object
    acl localhost src 127.0.0.1/255.255.255.255
    acl all src 0.0.0.0/0.0.0.0
    acl allowed_hosts src 172.16.135.76

    http_access deny manager all
    http_access allow allowed_hosts
    http_access deny all

    icp_access allow allowed_hosts
    icp_access deny all

    logfile_rotate 0




2. Initalise the cache:
% /usr/local/squid/sbin/squid -z

3. start the cache:
% /usr/local/squid/sbin/squid

squid在windows下安装,参考这里

没有评论: