Chinaunix首页 | 论坛 | 博客
  • 博客访问: 115607
  • 博文数量: 14
  • 博客积分: 400
  • 博客等级: 一等列兵
  • 技术积分: 150
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-19 21:52
文章分类
文章存档

2021年(2)

2016年(2)

2014年(1)

2011年(4)

2010年(5)

我的朋友

分类: LINUX

2010-11-21 17:38:11

由于某些ipv6的下载站(北邮人,六维空间等)限制只允许ipv6访问,而内部网络无法使用ipv6。因此在有ipv6地址的网关上安装squid以访问下载站,下载种子后通过网关的bt服务器下载,下载完成后通过ftp传到内网机器上。

squid从3.1版开始默认支持ipv6,详细可参考
而CentOS自带的squid较老,因此下载squid 3.1:

wget


安装:

rpm -ivh squid-3.1.8-1.el5.i386.rpm


可能会提示依赖perl(DBI), 安装之

yum install perl-DBI


安装后进行配置

vim /etc/squid/squid.conf


下面是我的配置,大部分采取了默认的参数。具体可以参考http://blog.chinaunix.net/u3/109134/showart_2134170.html

# Recommended minimum configuration:

acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
#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.0.0/24 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

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

#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
cache_dir ufs /var/spool/squid 1024 64 1024
cache_mem 32 MB

# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320


配置好以后检查配置文件,如果有错误会有提示

/usr/sbin/squid -k parse


初始化cache目录:

/usr/sbin/squid -z


启动squid服务:

/sbin/service squid start


在内网机器上测试。
设置好代理服务器地址端口后,打开,应该可以看到一个舞动的乌龟,表明是通过ipv6访问的。说明squid已经正常工作了,enjoy~
阅读(4192) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-11-22 18:01:37

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com