squid-2.6.STABLE1-之Web加速实做
来源:互联网 发布:js 移除子节点的class 编辑:程序博客网 时间:2024/05/18 23:57
2.6相对2.5有了一些改变,大家可以去看:http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE1-20060726-RELEASENOTES.html#s2
1. 下载squid2.6 http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE1-20060726.tar.gz
2. 安装:
wwwtest137#tar xzvf squid-2.6.STABLE1-20060726.tar.gz
wwwtest137#cd squid-2.6.STABLE1-20060726
wwwtest137#configure --prefix=/usr/local/squid --enable-dlmalloc --with-pthreads --enable-poll --disable-internal-dns --enable-stacktrace --enable-removal-policies="heap,lru" --enable-delay-pools --enable-storeio="aufs,coss,diskd,ufs"
wwwtest137#make
wwwtest137#make install
安装完成了。
因为是测试的,所以相关的参数可能并不是比较完善的,但是使用是没有问题的。
3. 配置:以下是部分关键配置,其他与2.5的相同
#squid.conf
#服务器IP 192.168.1.1
#监听服务器的80端口,透明代理,支持域名和IP的虚拟主机
http_port 192.168.1.1:80 transparent vhost vport
#限制同一IP客户端的最大连接数
acl OverConnLimit maxconn 16
http_access deny OverConnLimit
#防止天涯盗链,转嫁给百度
acl tianya referer_regex -i tianya
http_access deny tianya
deny_info http://www.baidu.com/logs.gif tianya
#防止被人利用为HTTP代理,设置允许访问的IP地址
acl myip dst 192.168.1.1
http_access deny !myip
#防止百度机器人爬死服务器
acl AntiBaidu req_header User-Agent Baiduspider
http_access deny AntiBaidu
#允许本地管理
acl Manager proto cache_object
acl Localhost src 127.0.0.1 192.168.1.1
http_access allow Manager Localhost
http_access deny Manager
#仅仅允许80端口的代理
acl Safe_ports port 80 # http
http_access deny !Safe_ports
http_access allow all
#Squid信息设置
visible_hostname www.test137.com
cache_mgr webmaster@test137.com
#基本设置
cache_effective_user squid
cache_effective_group squid
tcp_recv_bufsize 65535 bytes
#2.5的反向代理加速配置
#httpd_accel_host 127.0.0.1
#httpd_accel_port 80
#httpd_accel_single_host on
#httpd_accel_uses_host_header on
#httpd_accel_with_proxy on
#2.6的反向代理加速配置
#代理到本机的80端口的服务,仅仅做为原始内容服务器
cache_peer 127.0.0.1 parent 80 0 no-query originserver
#错误文档
error_directory /usr/local/squid/share/errors/Simplify_Chinese
#单台使用,不使用该功能
icp_port 0
4. http服务器配合设置:
http服务器,监听到127.0.0.1的80端口。
5. 数据走向:
访问者=>192.168.1.1:80=>127.0.0.1:80
6. 测试:
/usr/local/squid/sbin/squid -z
/usr/local/squid/sbin/squid -NCd1
好了,现在访问你的服务器看看,已经好了。
为了测试是否可用,把http服务器给停了,你就可以看到squid2.6的信息了。
另外,我们设置:
SQUID监听外部IP的80端口
HTTP服务器监听本机127.0.0.1的80端口
这样子不用任何防火墙参与,即可完成web反向代理加速。
1. 下载squid2.6 http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE1-20060726.tar.gz
2. 安装:
wwwtest137#tar xzvf squid-2.6.STABLE1-20060726.tar.gz
wwwtest137#cd squid-2.6.STABLE1-20060726
wwwtest137#configure --prefix=/usr/local/squid --enable-dlmalloc --with-pthreads --enable-poll --disable-internal-dns --enable-stacktrace --enable-removal-policies="heap,lru" --enable-delay-pools --enable-storeio="aufs,coss,diskd,ufs"
wwwtest137#make
wwwtest137#make install
安装完成了。
因为是测试的,所以相关的参数可能并不是比较完善的,但是使用是没有问题的。
3. 配置:以下是部分关键配置,其他与2.5的相同
#squid.conf
#服务器IP 192.168.1.1
#监听服务器的80端口,透明代理,支持域名和IP的虚拟主机
http_port 192.168.1.1:80 transparent vhost vport
#限制同一IP客户端的最大连接数
acl OverConnLimit maxconn 16
http_access deny OverConnLimit
#防止天涯盗链,转嫁给百度
acl tianya referer_regex -i tianya
http_access deny tianya
deny_info http://www.baidu.com/logs.gif tianya
#防止被人利用为HTTP代理,设置允许访问的IP地址
acl myip dst 192.168.1.1
http_access deny !myip
#防止百度机器人爬死服务器
acl AntiBaidu req_header User-Agent Baiduspider
http_access deny AntiBaidu
#允许本地管理
acl Manager proto cache_object
acl Localhost src 127.0.0.1 192.168.1.1
http_access allow Manager Localhost
http_access deny Manager
#仅仅允许80端口的代理
acl Safe_ports port 80 # http
http_access deny !Safe_ports
http_access allow all
#Squid信息设置
visible_hostname www.test137.com
cache_mgr webmaster@test137.com
#基本设置
cache_effective_user squid
cache_effective_group squid
tcp_recv_bufsize 65535 bytes
#2.5的反向代理加速配置
#httpd_accel_host 127.0.0.1
#httpd_accel_port 80
#httpd_accel_single_host on
#httpd_accel_uses_host_header on
#httpd_accel_with_proxy on
#2.6的反向代理加速配置
#代理到本机的80端口的服务,仅仅做为原始内容服务器
cache_peer 127.0.0.1 parent 80 0 no-query originserver
#错误文档
error_directory /usr/local/squid/share/errors/Simplify_Chinese
#单台使用,不使用该功能
icp_port 0
4. http服务器配合设置:
http服务器,监听到127.0.0.1的80端口。
5. 数据走向:
访问者=>192.168.1.1:80=>127.0.0.1:80
6. 测试:
/usr/local/squid/sbin/squid -z
/usr/local/squid/sbin/squid -NCd1
好了,现在访问你的服务器看看,已经好了。
为了测试是否可用,把http服务器给停了,你就可以看到squid2.6的信息了。
另外,我们设置:
SQUID监听外部IP的80端口
HTTP服务器监听本机127.0.0.1的80端口
这样子不用任何防火墙参与,即可完成web反向代理加速。
- squid-2.6.STABLE1-之Web加速实做
- squid-2.6.之Web加速实做
- squid-2.6之Web反向代理加速实做/防盗链/防盗用/防爬虫
- squid 2.6之Web反向代理加速实做/防盗链/防盗用/防爬虫
- Squid-2.6之集群(sibling模式)Web反向代理加速实
- squid+apache使web加速
- Squid反向代理加速WEB
- squid反向代理服务器加速web
- squid 2.6 + iptables 反向代理设置(加速web)
- Squid集群做CDN全网加速
- Squid集群做CDN全网加速
- Squid集群做CDN全网加速
- 用squid加速你的web
- squid加速WEB支持虚拟主机配置心得体会
- 架设Squid代理作为WEB缓存加速
- Web加速-Squid反向加速配置文档
- Web加速-Squid反向加速配置文档
- 如何实现用squid来加速多个web站点
- 国际足坛因伤退役的八大天才(七)
- 发些c/c++/vc/驱动/网络安全的好书和资料
- 国际足坛因伤退役的八大天才(八)
- 国际足坛因伤退役的八大天才(九)
- 解决explorer.exe 应用程序出错 问题
- squid-2.6.STABLE1-之Web加速实做
- 在IE6下打开PDF 提示 无法找到文件的问题
- 给我一个理由,让我买了你
- C与C++的区别
- jillzhang的文章索引
- 漫谈程序员与编程
- 学习C++从入门到精通的的十本最经典书籍
- Freebsd下 批量修改dos格式文件为unix格式 并删除空行
- 软件测试新手的修炼之路