(转载)OPENBSD + PF + SQUID

2009-05-13 11:29:01来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

转载 原文作者:llzqq  原文网址:
http://www.chinaunix.net/jh/5/591811.html

安装SQUID
# wget ftp://ftp.squid-cache.org/pub/squid-2/STABLE/squid-2.5.STABLE6.tar.gz
# wget http://ftp.it.net.au/OpenBSD/3.6/packages/i386/autoconf-2.13p0.tgz
# wget http://ftp.it.net.au/OpenBSD/3.6/packages/i386/gmake-3.80.tgz
# pkg_add autoconf-2.13p0.tgz
# pkg_add gmake-3.80.tgz
# tar zxvf squid-2.5.STABLE6.tar.gz
# cd squid-2.5.STABLE6
# ./configure
--prefix=/usr/local/squid
--sysconfdir=/etc/squid
--enable-ssl
--with-openssl
--enable-default-err-language=Simplify_Chinese
--enable-pf-transparent
--disable-hostname-checks
--disable-internal-dns
# make
# make install
# groupadd squid
# useradd –g squid –d /dev/null –s /sbin/nologin squid
# chown –R squid:squid /usr/local/squid/
配置SQUID
# >; /etc/squid/squid.conf
# vi /etc/squid/squid.conf
=========================squid.conf========================
http_port 127.0.0.1:3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 48 MB
cache_swap_low 80
cache_swap_high 90
maximum_object_size_in_memory 24 KB
cache_dir ufs /usr/local/squid/var/cache 100 16 256
cache_access_log /usr/local/squid/var/logs/access.log
cache_log none
cache_store_log none
emulate_httpd_log on
pid_filename /usr/local/squid/var/logs/squid.pid
dns_children 10
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 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 563
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443 563     # https, snews
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

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:(转载)如何使用 OpenBSD 3.2 作 ADSL 路由

下一篇:(转载)OpenBSD-FAQ集锦-请各位补充,切勿灌水!