FreeBSD下简易Http代理服务器安装笔记(Squid)

FreeBSD下简易Http代理服务器安装笔记(Squid)

一、更新ports
# csup -L 2 -h cvsup.freebsdchina.org /usr/share/examples/cvsup/ports-supfile

二、安装Squid
# cd /usr/ports/www/squid
# make install clean

三、生成密码文件
# htpasswd -c /usr/local/etc/squid/password username
输入两次密码即可生成密码文件

四、配置
# vi /usr/local/etc/squid/squid.conf

http_port 3128
cache_dir null /var/squid/cache/
cache_access_log /var/squid/logs/access.log
cache_log /var/squid/logs/cache.log
cache_store_log /var/squid/logs/store.log

acl all src 0.0.0.0/0

auth_param basic program /usr/local/libexec/squid/ncsa_auth /usr/local/etc/squid/password
auth_param basic children 5
auth_param basic credentialsttl 2 hours
auth_param basic realm bsdart.org
acl auth_user proxy_auth REQUIRED
http_access allow auth_user

五、建立缓存
# /usr/local/sbin/squid -z

六、启动服务
# vi /etc/rc.conf

squid_enable="YES"

# /usr/local/etc/rc.d/squid start

原文链接:http://dinggd.com/2012/11/freebsd%E4%B8%8B%E7%AE%80%E6%98%93http%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E8%A3%85%E7%AC%94%E8%AE%B0squid/

发表评论

电子邮件地址不会被公开。 必填项已用*标注