荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: cbi@bbs.pku.edu.cn (土豆|生活也许就是一种煎熬), 信区: Linux
标  题: Debian安装全攻略-3 squid zz
发信站: 北大未名站 (Thu Nov 13 13:23:45 2003)
转信站: SZU!news.ccie.net.cn!news.happynet.org!PKU

发信人: museli (沉思的风), 信区: Linux
标  题: Debian安装全攻略-3 squid
发信站: 瀚海星云 (Wed Sep 25 16:44:51 2002)

#这几篇文章可以下载到:
ftp://opt.ustc.edu.cn/incoming/debian.zip
#作者-李锋
#Email:fenglee@mail.ustc.edu.cn

squid不需要再重新安装,主要是配置文件

我最终配置出来的结果是这样的:

对客户端没有限制,都可以访问
对于国内站点,本服务器直接连接
对于国外站点,通过二级代理连接
对于特定的,需要本机直接连的国外学术站点,进行身份验证
当然,如果想要对别的进行身份验证,也是可以的

配置文件:/etc/squid.conf
# ##########
# PORT SET #
# ##########

http_port 1234 5678
#这里可以设置多个端口,但是其效果是同等的
icp_port 3130

# ###########
# 二级代理###
# ###########

cache_peer 202.118.129.14 parent 8080 0 no-delay no-query proxy-only
#8080是二级代理的http proxy port 0是icp端口,没有就是0

# ############
# DNS SERVER #
# ############

dns_nameservers 202.38.64.1 202.38.75.11

# ########
# acl SET#
# ########

acl all src 0.0.0.0/0.0.0.0
acl all_dst dst 0.0.0.0/255.255.255.255
acl manager proto cache_object
acl proto proto HTTP FTP
acl auth proxy_auth REQUIRED
authenticate_program /usr/lib/squid/ncsa_auth /etc/squid/passwd
#先确认一下/usr/lib/squid/ncsa_auth存在不存在,否则要安装
authenticate_children 2
proxy_auth_realm ***.***.***.**
#你的域名

hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY

acl target_abroad dst "/etc/squid/target.abroad"
#这是通过二级代理的站点
acl target_china dst "/etc/squid/target.china"
#这是国内站点
acl target_xueshu dst "/etc/squid/target.xueshu"
#这是直接连的国外站点
acl google dstdomain www.google.com
#google现在可以直接连了,就直接连

acl localhost src 127.0.0.1/255.255.255.255

acl SSL_ports port 443 563
acl Safe_ports port 80 21 443 563 70 210 1025-65535
acl Dangerous_ports port 7 9 19 22 23 25 53 109 110 119
acl purge method PURGE
acl CONNECT method CONNECT

# ###############
# allow and deny#
# ###############

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny Dangerous_ports
http_access deny CONNECT !SSL_ports

always_direct allow target_china
always_direct allow target_xueshu
always_direct allow google
never_direct allow target_abroad
#这很明白吧

http_access allow !target_xueshu
http_access allow auth target_xueshu
#除了要花钱的,都不要身份验证

http_access deny all
# ##########
# Cache Set#
# ##########

cache_dir ufs /var/spool/squid 1000 16 256
#1000是缓存大小,单位MB,16是缓存一级目录数,256是二级目录数
cache_mem 64 MB
httpd_accel_with_proxy off
httpd_accel_port 80

# ###########
# log option#
#############
logfile_rotate 5
#这是log文件的保留数目

下面把我费了很大劲搞的target.***写出来
#/etc/squid/target.abroad
0.0.0.0
#/etc/squid/target.xueshu
这里就自己定义吧,
看自己的需要了
#/etc/squid/target.china
24.244.192.0-24.244.207.255
47.153.128.0-47.153.191.255
61.13.6.0-61.13.6.255
61.13.20.0-61.13.20.255
61.13.50.0-61.13.50.255
61.13.73.0-61.13.73.255
61.13.138.0-61.13.138.255
61.13.160.0-61.13.160.255
61.13.191.0-61.13.191.255
61.16.8.0-61.16.8.255
61.16.125.0-61.16.125.255
61.28.0.0-61.28.15.255
61.41.2.0-61.41.2.255
61.48.0.0-61.49.255.255
61.51.0.0-61.51.31.255
61.128.0.0-61.131.255.255
61.132.0.0-61.133.255.255
61.134.0.0-61.134.255.255
61.135.0.0-61.135.127.255
61.135.128.0-61.135.159.255
61.135.160.0-61.135.167.255
61.135.168.0-61.135.169.255
61.135.224.0-61.135.255.255
61.136.0.0-61.143.255.255
61.144.0.0-61.159.255.255
61.160.0.0-61.175.255.255
61.176.0.0-61.183.255.255
61.184.0.0-61.187.255.255
61.188.0.0-61.189.255.255
61.190.0.0-61.190.255.255
61.232.0.0-61.235.255.255
61.236.0.0-61.237.255.255
61.240.0.0-61.240.127.255
61.240.128.0-61.240.143.255
61.240.160.0-61.240.191.255
61.241.0.0-61.241.255.255
61.242.0.0-61.243.255.255
63.108.12.0-63.108.12.255
63.144.212.0-63.144.215.255
137.189.0.0-137.189.255.255
140.113.0.0-140.113.255.255
140.244.0.0-140.244.255.255
143.89.0.0-143.89.255.255
144.214.0.0-144.214.255.255
147.8.0.0-147.8.255.255
152.85.0.0-152.85.255.255
152.86.0.0-152.87.255.255
152.101.4.0-152.101.5.255
152.101.32.0-152.101.32.255
152.101.38.0-152.101.38.255
152.101.75.0-152.101.75.255
152.101.80.0-152.101.80.255
152.101.93.0-152.101.93.255
152.101.99.0-152.101.99.255
152.101.105.0-152.101.105.255
152.101.106.0-152.101.106.255
152.101.113.0-152.101.113.255
152.101.117.0-152.101.117.255
152.101.118.0-152.101.119.255
152.104.0.0-152.104.255.255
155.40.0.0-155.40.255.255
155.46.0.0-155.46.255.255
158.132.0.0-158.132.255.255
158.182.0.0-158.182.255.255
159.226.0.0-159.226.255.255
161.207.0.0-161.207.255.255
162.93.0.0-162.93.255.255
162.105.0.0-162.105.255.255
165.193.0.0-165.193.255.255
166.111.0.0-166.111.255.255
167.139.0.0-167.139.255.255
167.216.0.0-167.216.255.255
168.106.2.0-168.106.3.255
168.106.22.0-168.106.22.255
168.160.0.0-168.160.255.255
170.148.128.0-170.148.159.255
192.11.236.0-192.11.236.255
192.124.154.0-192.124.154.255
192.139.135.0-192.139.135.255
192.139.136.0-192.139.136.255
192.170.79.0-192.170.79.255
192.207.91.0-192.207.91.255
192.245.196.0-192.245.196.255
192.245.208.0-192.245.208.255
194.138.202.0-194.138.202.255
198.80.144.0-198.80.144.255
198.80.156.0-198.80.156.255
198.80.189.0-198.80.189.255
198.80.191.0-198.80.191.255
198.112.160.0-198.112.191.255
200.9.41.0-200.9.41.255
202.0.170.0-202.0.171.255
202.0.172.0-202.0.173.255
202.0.182.0-202.0.183.255
202.2.83.0-202.2.83.255
202.2.84.0-202.2.85.255
202.4.128.0-202.4.159.255
202.4.252.0-202.4.255.255
202.5.17.0-202.5.17.255
202.12.19.0-202.12.19.255
202.14.80.0-202.14.80.255
202.14.235.0-202.14.235.255
202.14.236.0-202.14.236.255
202.14.238.0-202.14.238.255
202.20.100.0-202.20.101.255
202.21.128.0-202.21.128.255
202.22.252.0-202.22.255.255
202.38.0.0-202.38.15.255
202.38.16.0-202.38.19.255
202.38.45.0-202.38.45.255
202.38.64.0-202.38.127.255
202.38.128.0-202.38.129.255
202.38.132.0-202.38.135.255
202.38.147.0-202.38.147.255
202.38.152.0-202.38.153.255
202.38.161.0-202.38.161.255
202.38.164.0-202.38.167.255
202.38.176.0-202.38.176.255
202.38.192.0-202.38.255.255
202.40.137.0-202.40.137.255
202.40.138.0-202.40.139.255
202.40.157.0-202.40.157.255
202.40.192.0-202.40.207.255
202.40.208.0-202.40.215.255
202.40.216.0-202.40.219.255
202.40.220.0-202.40.220.255
202.40.222.0-202.40.223.255
202.45.32.0-202.45.63.255
202.45.128.0-202.45.128.255
202.52.70.0-202.52.70.255
202.52.79.0-202.52.79.255
202.64.186.0-202.64.186.255
202.65.96.0-202.65.111.255
202.65.160.0-202.65.175.255
202.66.12.0-202.66.12.255
202.66.21.0-202.66.21.255
202.66.28.0-202.66.28.255
202.66.51.0-202.66.51.255
202.66.53.0-202.66.53.255
202.66.73.0-202.66.73.255
202.66.74.0-202.66.74.255
202.66.79.0-202.66.79.255
202.66.86.0-202.66.87.255
202.66.89.0-202.66.89.255
202.66.91.0-202.66.91.255
202.66.118.0-202.66.119.255
202.66.128.0-202.66.191.255
202.67.128.0-202.67.255.255
202.69.0.0-202.69.3.255
202.70.0.0-202.70.31.255
202.71.0.0-202.71.31.255
202.71.192.0-202.71.255.255
202.72.252.0-202.72.255.255
202.75.64.0-202.75.71.255
202.75.72.0-202.75.75.255
202.76.4.0-202.76.4.255
202.76.26.0-202.76.26.255
202.76.56.0-202.76.56.255
202.76.88.0-202.76.88.255
202.76.92.0-202.76.92.255
202.76.105.0-202.76.105.255
202.77.10.0-202.77.11.255
202.77.33.0-202.77.33.255
202.77.39.0-202.77.39.255
202.80.5.0-202.80.5.255
202.84.10.0-202.84.11.255
202.84.16.0-202.84.17.255
202.85.168.0-202.85.175.255
202.87.0.0-202.87.3.255
202.89.0.0-202.89.3.255
202.91.128.0-202.91.131.255
202.91.224.0-202.91.255.255
202.92.0.0-202.92.3.255
202.93.0.0-202.93.15.255
202.93.252.0-202.93.255.255
202.94.0.0-202.94.31.255
202.95.0.0-202.95.31.255
202.96.0.0-202.96.255.255
202.97.0.0-202.97.63.255
202.97.96.0-202.97.127.255
202.97.128.0-202.97.255.255
202.98.0.0-202.99.255.255
202.100.0.0-202.103.255.255
202.104.0.0-202.111.255.255
202.112.0.0-202.119.255.255
202.120.0.0-202.121.255.255
202.122.1.0-202.122.1.255
202.122.7.0-202.122.7.255
202.122.128.0-202.122.128.255
202.127.0.0-202.127.1.255
202.127.3.0-202.127.3.255
202.127.12.0-202.127.15.255
202.127.16.0-202.127.31.255
202.127.40.0-202.127.47.255
202.127.48.0-202.127.49.255
202.127.144.0-202.127.159.255
202.127.160.0-202.127.167.255
202.127.192.0-202.127.193.255
202.127.200.0-202.127.207.255
202.127.208.0-202.127.209.255
202.130.0.0-202.130.31.255
202.130.152.0-202.130.153.255
202.130.224.0-202.130.255.255
202.131.208.0-202.131.223.255
202.134.64.0-202.134.95.255
202.136.254.0-202.136.255.255
202.172.210.0-202.172.210.255
202.181.32.0-202.181.33.255
202.181.38.0-202.181.39.255
202.182.224.0-202.182.225.255
202.182.252.0-202.182.255.255
202.192.0.0-202.207.255.255
203.65.240.0-203.65.243.255
203.81.16.0-203.81.31.255
203.84.63.0-203.84.63.255
203.85.21.0-203.85.21.255
203.85.28.0-203.85.29.255
203.85.134.0-203.85.134.255
203.85.137.0-203.85.137.255
203.85.156.0-203.85.156.255
203.85.174.0-203.85.174.255
203.85.177.0-203.85.177.255
203.85.191.0-203.85.191.255
203.85.208.0-203.85.208.255
203.87.224.0-203.87.255.255
203.88.0.0-203.88.3.255
203.90.0.0-203.90.3.255
203.93.0.0-203.93.255.255
203.94.0.0-203.94.3.255
203.95.0.0-203.95.7.255
203.98.128.0-203.98.191.255
203.128.128.0-203.128.159.255
203.131.224.0-203.131.255.255
203.149.157.0-203.149.157.255
203.149.177.0-203.149.177.255
203.149.199.0-203.149.199.255
203.149.203.0-203.149.203.255
203.149.230.0-203.149.230.255
203.160.64.0-203.160.95.255
203.168.132.0-203.168.135.255
203.169.128.0-203.169.191.255
203.192.0.0-203.192.31.255
203.196.0.0-203.196.7.255
203.207.64.0-203.207.127.255
203.207.128.0-203.207.255.255
203.208.0.0-203.208.15.255
203.208.16.0-203.208.16.255
203.212.0.0-203.212.15.255
205.140.156.0-205.140.159.255
205.215.224.0-205.215.239.255
206.33.24.0-206.33.31.255
206.33.32.0-206.33.47.255
206.157.240.0-206.157.247.255
206.207.146.0-206.207.146.255
206.219.44.0-206.219.45.255
206.219.50.0-206.219.51.255
206.219.52.0-206.219.53.255
206.220.224.0-206.220.227.255
206.253.223.0-206.253.223.255
207.45.211.0-207.45.211.255
207.45.222.0-207.45.222.255
207.97.188.0-207.97.188.255
207.176.96.0-207.176.97.255
207.189.64.0-207.189.95.255
207.201.0.0-207.201.63.255
208.133.200.0-208.133.203.255
208.133.206.0-208.133.206.255
208.165.48.0-208.165.63.255
209.148.0.0-209.148.63.255
210.5.0.0-210.5.31.255
210.12.0.0-210.13.255.255
210.14.160.0-210.14.191.255
210.14.192.0-210.14.255.255
210.15.0.0-210.15.127.255
210.15.128.0-210.15.191.255
210.21.0.0-210.21.255.255
210.22.0.0-210.22.255.255
210.25.0.0-210.25.127.255
210.25.128.0-210.25.191.255
210.25.192.0-210.25.223.255
210.25.224.0-210.25.239.255
210.25.240.0-210.25.240.255
210.25.242.0-210.25.243.255
210.25.244.0-210.25.247.255
210.25.248.0-210.25.255.255
210.26.0.0-210.27.255.255
210.28.0.0-210.31.255.255
210.32.0.0-210.47.255.255
210.51.0.0-210.51.255.255
210.52.0.0-210.53.255.255
210.62.128.0-210.62.135.255
210.62.152.0-210.62.152.255
210.72.0.0-210.73.255.255
210.74.32.0-210.74.63.255
210.74.64.0-210.74.65.255
210.74.96.0-210.74.127.255
210.74.128.0-210.74.255.255
210.75.32.0-210.75.63.255
210.75.96.0-210.75.127.255
210.75.128.0-210.75.255.255
210.76.0.0-210.76.127.255
210.76.160.0-210.76.191.255
210.76.192.0-210.76.223.255
210.76.233.0-210.76.233.255
210.77.0.0-210.77.63.255
210.77.96.0-210.77.127.255
210.77.128.0-210.77.159.255
210.77.160.0-210.77.175.255
210.77.192.0-210.77.255.255
210.78.0.0-210.78.31.255
210.78.128.0-210.78.159.255
210.78.168.0-210.78.168.255
210.79.224.0-210.79.255.255
210.82.0.0-210.83.255.255
210.184.7.0-210.184.7.255
210.184.24.0-210.184.24.255
210.184.78.0-210.184.78.255
210.192.96.0-210.192.127.255
210.244.159.0-210.244.159.255
210.244.172.0-210.244.172.255
210.244.176.0-210.244.176.255
211.64.0.0-211.71.255.255
211.80.0.0-211.87.255.255
211.88.0.0-211.88.255.255
211.90.0.0-211.91.255.255
211.92.0.0-211.92.255.255
211.93.0.0-211.93.127.255
211.93.128.0-211.93.191.255
211.94.0.0-211.95.255.255
211.96.0.0-211.99.255.255
211.100.0.0-211.100.127.255
211.100.192.0-211.100.207.255
211.100.224.0-211.100.255.255
211.101.0.0-211.101.63.255
211.101.128.0-211.101.255.255
211.102.0.0-211.102.127.255
211.103.0.0-211.103.127.255
211.136.0.0-211.143.255.255
211.144.0.0-211.144.31.255
211.144.32.0-211.144.47.255
211.144.64.0-211.144.127.255
211.144.128.0-211.144.159.255
211.144.160.0-211.144.175.255
211.144.192.0-211.144.255.255
211.146.0.0-211.146.255.255
211.147.0.0-211.147.127.255
211.147.128.0-211.147.191.255
211.147.192.0-211.147.223.255
211.148.128.0-211.148.159.255
211.148.192.0-211.148.223.255
211.149.0.0-211.149.255.255
211.150.0.0-211.151.255.255
211.152.0.0-211.153.255.255
211.154.32.0-211.154.63.255
211.154.64.0-211.154.127.255
211.154.128.0-211.154.255.255
211.155.0.0-211.155.63.255
211.155.64.0-211.155.95.255
211.155.160.0-211.155.191.255
211.155.192.0-211.155.255.255
211.156.0.0-211.156.31.255
211.156.32.0-211.156.47.255
211.156.64.0-211.156.79.255
211.156.96.0-211.156.127.255
211.156.128.0-211.156.191.255
211.156.224.0-211.156.239.255
211.157.0.0-211.157.255.255
211.158.0.0-211.158.63.255
211.159.0.0-211.159.127.255
211.159.150.0-211.159.151.255
211.159.152.0-211.159.159.255
211.160.0.0-211.163.255.255
211.164.0.0-211.165.255.255
211.166.0.0-211.166.255.255
211.167.0.0-211.167.127.255
211.167.128.0-211.167.159.255
211.167.160.0-211.167.175.255
211.167.192.0-211.167.255.255
211.196.176.0-211.196.191.255
216.72.225.0-216.72.225.255
218.0.0.0-218.15.255.255
218.16.0.0-218.23.255.255
218.24.0.0-218.27.255.255
218.28.0.0-218.29.255.255
218.30.0.0-218.30.15.255
218.30.16.0-218.30.19.255
218.30.30.0-218.30.31.255
218.30.38.0-218.30.39.255
218.30.224.0-218.30.255.255
218.31.0.0-218.31.255.255
218.56.0.0-218.63.255.255
218.64.0.0-218.71.255.255
218.75.128.0-218.75.255.255
218.76.0.0-218.79.255.255
218.80.0.0-218.83.255.255
218.84.0.0-218.84.255.255
218.88.0.0-218.91.255.255
218.94.0.0-218.94.255.255
218.95.224.0-218.95.255.255
218.96.0.0-218.96.255.255
218.97.0.0-218.97.127.255
218.97.128.0-218.97.191.255
218.97.192.0-218.97.223.255
218.97.224.0-218.97.239.255
218.98.0.0-218.98.63.255
218.98.64.0-218.98.95.255
218.99.0.0-218.99.31.255
218.104.0.0-218.104.63.255
218.104.64.0-218.104.95.255
218.104.96.0-218.104.111.255
218.104.128.0-218.104.191.255
218.104.192.0-218.104.223.255
218.104.224.0-218.104.239.255
218.105.0.0-218.105.15.255
218.105.16.0-218.105.23.255
218.105.64.0-218.105.79.255
218.105.136.0-218.105.143.255
218.106.224.0-218.106.255.255
218.108.0.0-218.108.255.255
218.192.0.0-218.199.255.255
218.200.0.0-218.203.255.255
218.204.0.0-218.205.255.255
218.240.0.0-218.240.255.255
218.241.64.0-218.241.79.255
218.242.0.0-218.243.255.255
218.244.32.0-218.244.63.255
218.244.96.0-218.244.127.255
218.244.192.0-218.244.207.255
218.244.224.0-218.244.255.255
218.245.0.0-218.245.255.255
219.216.0.0-219.217.255.255


--


  ╭─╮                                                          ╭-e
  ├─┼-                                                         (╲ ╲
  § _∕ˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉˉ╰﹨\ ╲
  ∕ ﹨       抱歉!我是个艺术家,所以凝视美女是我的工作!          ∕

※ 来源:·北大未名站 bbs.pku.edu.cn·[FROM: 162.105.40.16]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店