Chinaunix首页 | 论坛 | 博客
  • 博客访问: 506521
  • 博文数量: 110
  • 博客积分: 3971
  • 博客等级: 中校
  • 技术积分: 1175
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-20 23:27
文章分类

全部博文(110)

文章存档

2015年(2)

2014年(1)

2013年(1)

2011年(9)

2010年(28)

2009年(12)

2008年(13)

2007年(23)

2006年(21)

我的朋友

分类: WINDOWS

2010-02-07 23:04:50

 
 
 
server setup
 ETH0 - connecting to ADSL modem
ETH2 - serving LAN users
1.获取源码:
 
wget
 
# ./configure --prefix=/usr/local/squid --enable-useragent-log --enable-referer-log \
--enable-linux-netfilter --enable-auth=basic --enable-basic-auth-helpers=NCSA
 
# make all
 
# make install
 
 
configure your squid
 
# iptables -t nat -A PREROUTING -d ! 192.168.0.0/16 -i eth2 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3129

http_port 3129 transparent

认证

配置squid来验证

http_port 3128

您还需要添加这些行

 auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/passwd
 auth_param basic children 5
 auth_param basic realm Squid proxy-caching web server
 acl users proxy_auth REQUIRED
 
确保ncsa_auth在那里。 如果没有,请编译并安装如下:
# cd helpers/basic_auth/NCSA/
# make install
 
安装htpasswd,
apt-cache search htpasswd

可以看到htpasswd工具包含在apache2-utils里
 
 apt-get install apache2-utils
另外,还要确保您有文件/usr/local/squid/etc/passwd.如果没有,使用htpasswd生成它
第一次用'-c'来产生/etc/squid/passwd 文件,产生其他的用户名和密码时,不要用-c
 
# htpasswd -c /usr/local/squid/etc/passwd squiduser1
 
# cat /usr/local/squid/etc/passwd
 
# chown -R nobody.nogroup /usr/local/squid
 
#删除用户
htpasswd -b -D /etc/squid/passwd usrname passwd
 
videocache
 
root@home:/tmp# wget


 root@home:/tmp# wget
 root@home:/tmp# tar zxvf urlgrabber-3.1.0.tar.gz
root@home:/tmp# tar zxvf iniparse-0.3.1.tar.gz
root@home:/tmp# cd urlgrabber-3.1.0
root@home:/tmp# python setup.py install
#apt-get install python-urlgrabber
root@home:/tmp# cd ../iniparse-0.3.1
root@home:/tmp# python setup.py install
 
# apt-get install apache2
 
root@home:/tmp# wget
root@home:/tmp# tar zxvf videocache-1.9.1.tar.gz
root@home:/tmp# cd videocache-1.9.1
 
 root@home:/tmp# vi setup.py
 root@home:/tmp# python setup.py install
 

 
 
 
 
 
阅读(1033) | 评论(0) | 转发(0) |
0

上一篇:goto

下一篇:squid-2.6

给主人留下些什么吧!~~