您的位置:首页 > 运维架构 > 反向代理

squid反向代理安装实战

2007-09-21 01:25 309 查看
1,以yum方式安装

2,配置:
#squid.conf
http_port 8080

#max link per client
acl OverConnLimit maxconn 16
http_access deny OverConnLimit

#access limit
acl myip dst 192.168.155.36
http_access deny !myip

#allow admin from local
acl Manager proto cache_object
acl Localhost src 127.0.0.1 192.168.155.36
http_access allow Manager Localhost
http_access deny Manager

#only for port 80
acl all src 0.0.0.0/0.0.0.0
acl Safe_ports port 80
http_access deny !Safe_ports
http_access allow all

#Squid info
visible_hostname www.mydomain.com.cn
cache_mgr info@cnfoto.com.cn

#base setup
cache_dir ufs /usr/local/squid/cache 1024 16 256
cache_mem 512 MB
cache_effective_user squid
cache_effective_group squid
tcp_recv_bufsize 65535 bytes

httpd_accel_host 192.168.155.36
httpd_accel_port 80
httpd_accel_single_host on
httpd_accel_uses_host_header on
httpd_accel_with_proxy on
#2.6 cache
#cache_peer 192.168.155.36 parent 80 0 no-query originserver

#error document
error_directory /usr/share/squid/errors/Simplify_Chinese

#for single
icp_port 0

3,备注:
/usr/local/squid/cache目录应该设置为chown squid.squid /usr/local/squid/cache
squid -z 创建cache的目录

4,todo list
1,编译安装2.6
2,cronolog
3,设置
4,优化
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: