高速透明代理

2009-05-13 10:18:34来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

硬件配置:
     845G
     intel Celeron 1.7G  
     DDR_I  1G  
     QUANTUM FIREBALL 10G
网络配置
                       10M网通光纤58.253.*.*   
                                |
               ------------- fb + pf(nat) ------
               |                |              |
  dmz(10.0.0.0/8)  vlan(192.168.0.0/16)    other(172.16.0.0/16)

下面总共大概1000个点,同时在线平均300人。pf上把80端口的对外访问都转发到squid(10.0.0.50),其他端口做nat,从而实现网页的透明代理。



准备:mini安装fb62,更新ports。
一、安装Squid
   
使用squid24的版本,port默认安装。
二、配置内存文件系统
   
squid的cache如果保存在硬盘上的话,我的“火球”顶不住,硬盘的读写很频繁。所以使用内存文件系统。
   
# mdmfs -M -s 600m -O time -o noatime -p 0700 -v 2 -w squid:squid md0 /usr/local/squid/cache
我的Ram是1G,这里给了600M做cache,其他参数都是针对squid默认安装的。
为了开机自动加载,在/etc/fstab中加入如下一行:
/dev/md0        /usr/local/squid/cache  mfs     rw,-s600m       2       0
三、配置squid
# ee /usr/local/etc/squid/squid.conf
==========================================
cache_store_log none
cache_access_log /dev/null
#cache_log /dev/null
#cache_store_log /usr/local/squid/logs/store.log
#cache_access_log /usr/local/squid/logs/access.log
cache_log /usr/local/squid/logs/cache.log
emulate_httpd_log on
pid_filename /usr/local/squid/logs/squid.pid
cache_effective_user squid
cache_effective_group squid
visible_hostname proxy.XXXXXXXXXXX.com
cache_mgr
zy5451@163.com
http_port 3128
udp_incoming_address 10.0.0.50
cache_dir ufs /usr/local/squid/cache 512 16 256      //512表示硬盘cache的大小
cache_mem 64 MB                                      // 内存canche大小
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
half_closed_clients off
cache_swap_high 90%
cache_swap_low 80%
maximum_object_size 1024 KB
icon_directory /usr/local/etc/squid/icons
error_directory /usr/local/etc/squid/errors/Simplify_Chinese

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:FreeBSD Is Beautiful

下一篇:OpenLDAP调试