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
阅读(1043) | 评论(0) | 转发(0) |