freebsd下安装squid代理上网

简介:
1、安装squid
--------------------------------------------------
freebsd# cd /usr/ports/www/squid3
freebsd# make install clean
2、编辑squid.conf
-------------------------------------------------
vi /usr/local/etc/squid.conf
http_port 80
cache_effective_user nobody
cache_effective_group nobody
cache_mem 512 MB
maximum_object_size_in_memory 10MB
memory_replacement_policy lru
cache_dir ufs /usr/local/squid/cache 8000 32 128
max_open_disk_fds 0
maximum_object_size 200MB
pid_filename /usr/local/squid/var/logs/squid.pid
cache_swap_low 90
cache_swap_high 95
cache_store_log none
http_access allow all
3、启动squid
---------------------------------------------
freebsd# chmod -R 777 /usr/local/squid
freebsd# chmod -R 777 /usr/local/etc/squid
freebsd# /usr/local/sbin/squid -z
freebsd# /usr/local/etc/rc.d/squid start
 
4、添加规则
-------------------------------------------
freebsd# vi /etc/rc.conf
squid_enable="YES"
freebsd# vi /etc/pf.conf
pass in quick proto tcp from any to $ext_if port 80

5、设置用户认证
---------------------------------------------
freebsd# htpasswd -c /usr/local/etc/squid/sqpasswd king     //生成sqpasswd认证文件,并创建king用户
freebsd# htpasswd /usr/local/etc/squid/sqpasswd kerry       //添加kerry用户
修改squid.conf,enable ncsa_auth用户认证功能
vi /usr/local/etc/squid.conf
auth_param basic program /usr/local/libexec/squid/ncsa_auth /usr/local/etc/squid/sqpasswd
acl jav proxy_auth kerry king
http_access allow jav
 


本文转自king_819 51CTO博客,原文链接:http://blog.51cto.com/kerry/237845,如需转载请自行联系原作者
相关文章
|
6月前
|
Unix Linux
Linux/FreeBSD 安装
在Linux/FreeBSD上安装Julia 1.7.2的步骤:从[官方](https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.2-linux-x86_64.tar.gz)或[Tsinghua镜像](https://mirrors.tuna.tsinghua.edu.cn/julia-releases/bin/linux/x86/1.7/julia-1.7.2-linux-i686.tar.gz)下载二进制包,然后使用`tar`解压。
|
Unix 网络安全 C语言
|
Shell Unix 域名解析
|
数据安全/隐私保护 网络协议 Unix
|
关系型数据库 测试技术 PHP