| |
# vi squid.conf #新建文件
A. 模式1:Squid对应多台web服务器
A1。在vi /etc/hosts中:加入内部的DNS解析,比如:
192.168.0.9 www.5538.com
192.168.0.66 bbs.5538.com
A2。#vi /Data/apps/squid/etc/squid.conf
代码如下:
# visible name
visible_hostname cache.5538.com
# cache config: space use 1G and memory use 256M
cache_dir ufs /Data/apps/squid/cache 1024 16 256
cache_mem 256 MB
cache_effective_user squid #设置运行时的用户和组权限
cache_effective_group squid
# 反向加速配置
http_port 80 # squid监听的端口,客户访问网站的端口
httpd_accel_host virtual # WEB服务器的IP地址,此模式下设置为:virtual
httpd_accel_single_host off # 设置on时缓冲请求到单台Server,off对应virtual
httpd_accel_port 80 # WEB服务器的端口(对于多台web服务器,端口必须一致)
httpd_accel_uses_host_header on # 完成多个WEB服务器的反向代理功能
httpd_accel_with_proxy off # 停用代理本地上网
# accelerater my domain only
acl acceleratedHostA dstdomain www.5538.com
acl acceleratedHostB dstdomain bbs.5538.com
# accelerater http protocol on port 80
acl acceleratedProtocol protocol HTTP
acl acceleratedPort port 80
# access arc
acl all src 0.0.0.0/0.0.0.0
# Allow requests when they are to the accelerated machine and to the right port with right protocol
http_access allow acceleratedProtocol acceleratedPort acceleratedHostA
http_access allow acceleratedProtocol acceleratedPort acceleratedHostB
http_access allow all
# logging
emulate_httpd_log on
cache_store_log none
# manager
acl manager proto cache_object
http_access allow manager all
cachemgr_passwd pass all
cache_mgr admin@5538.com
#swap 性能微调
half_closed_clients off
cache_swap_high 100%
cache_swap_low 95%
maximum_object_size 1024 KB
# 控制对象的超时时间 (S_Data-Data) |
| 网签地址:http://leftleg.hzpub.com/post/594/ |
|
| |
我的简介 |
| |
|
|
|
|
|
| |
|
|
|
| << |
< 七月 2009 |
|
| 日 |
一 |
二 |
三 |
四 |
五 |
六 |
| |
|
|
1 |
2 |
3 |
4 |
| 5 |
6 |
7 |
8 |
9 |
10 |
11 |
| 12 |
13 |
14 |
15 |
16 |
17 |
18 |
| 19 |
20 |
21 |
22 |
23 |
24 |
25 |
| 26 |
27 |
28 |
29 |
30 |
31 |
|
|
|
|
|
|
|
|
|
|
|
|