CentOS 6.7 下 Squid 代理服务器 的 安装与配置
GFW 封锁了 HTTP/Socks5 代理,HTTP 代理是关键词过滤,Socks5 代理则是封锁协议。不过某些特殊的低端口并没有这么处理,已知的有 21,25。
20端口已经被封杀,21端口目前会被限速400Kbps,换算后约合50KB/S,建议使用25端口,不限速。
一、系统环境
操作系统:CentOS release 6.7 (Final)
Squid版本:squid-3.1.10-20.el6_5.3.x86_64
SELINUX=disabled
HTTP Service: stoped
二、安装Squid服务
2.1 检查squid软件是否安装
# rpm -qa|grep squid
2.2 如果未安装,则使用yum 方式安装
# yum -y install squid

2.3 设置开机自启动
# chkconfig squid on //自动运行squid服务
# squid -z //建立缓存目录
2.4 配置squid,修改或增加红色部分
#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/ ::
acl to_localhost dst 127.0.0.0/ 0.0.0.0/ :: # Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/ # RFC1918 possible internal network
acl localnet src 172.16.0.0/ # RFC1918 possible internal network
acl localnet src 192.168.0.0/ # RFC1918 possible internal network
acl localnet src fc00::/ # RFC local private network range
acl localnet src fe80::/ # RFC link-local (directly plugged) machines acl SSL_ports port
acl Safe_ports port # http
acl Safe_ports port # ftp
acl Safe_ports port # https
acl Safe_ports port # gopher
acl Safe_ports port # wais
acl Safe_ports port - # unregistered ports
acl Safe_ports port # http-mgmt
acl Safe_ports port # gss-http
acl Safe_ports port # filemaker
acl Safe_ports port # multiling http
acl CONNECT method CONNECT #
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager # Deny requests to certain unsafe ports
http_access deny !Safe_ports # Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports # We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost #
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
# # Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost # And finally deny all other access to this proxy
#http_access deny all
http_access allow all # Squid normally listens to port
http_port 191.101.9.188:25 transparent # Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 5000 16 256 # Leave coredumps in the first cache dir
coredump_dir /var/spool/squid # Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: %
refresh_pattern ^gopher: %
refresh_pattern -i (/cgi-bin/|\?) %
refresh_pattern . % strip_query_terms off
visible_hostname 191.101.9.188
cache_mgr xxxxx@qq.com
cache_store_log none
cache_access_log none
cache_mem 512 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 128 MB
maximum_object_size_in_memory 128 MB
dns_nameservers 8.8.8.8 8.8.4.4
client_lifetime 1 minutes
half_closed_clients off
fqdncache_size 65535
ipcache_size 65535
ipcache_low 90
ipcache_high 95
三、配置防火墙
开放25端口
# iptables -I INPUT -p tcp --dport -j ACCEPT # service iptables save
或编辑 vi /etc/sysconfig/iptables
# Completed on Thu May ::
# Generated by iptables-save v1.4.7 on Thu May ::
*filter
:INPUT ACCEPT [:]
:FORWARD ACCEPT [:]
:OUTPUT ACCEPT [:]
-A INPUT -p tcp -m state --state NEW -m tcp --dport -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT
COMMIT
# Completed on Thu May ::
重启 service iptables restart
ps:
http://bbs.itzmx.com/thread-8815-1-1.html
http://www.cnblogs.com/mchina/p/3812190.html
http://blog.163.com/na_llong/blog/static/1135416092013714104354316/
CentOS 6.7 下 Squid 代理服务器 的 安装与配置的更多相关文章
- CentOS 6.4下Squid代理服务器的安装与配置,反向代理
CentOS 6.4下Squid代理服务器的安装与配置 一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件 ...
- 【转载】CentOS 6.4下Squid代理服务器的安装与配置
一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件,其接收用户的下载申请,并自动处理所下载的数据.当一个用 ...
- CentOS 6.4下Squid代理服务器的安装与配置
一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件,其接收用户的下载申请,并自动处理所下载的数据.当一个用 ...
- [转]CentOS 6.4下Squid代理服务器的安装与配置
一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件,其接收用户的下载申请,并自动处理所下载的数据.当一个用 ...
- CentOS 6.4下Squid代理服务器的安装与配置(转)
add by zhj: 其实我们主要还是关注它在服务器端使用时,充当反向代理和静态数据缓存.至于普通代理和透明代理,其实相当于客户端做的事,和服务端没有什么关系.另外,Squid的缓存主要是缓存在硬盘 ...
- CentOS 6.5下Squid代理服务器的安装与配置
1.1 缓存代理概述 作为应用层的代理服务器软件,squid主要提供缓存加速,应用层过滤控制的功能. 1. 代理的工作机制 当客户机通过代理来请求web页面时,指定的代理服务器会先检查自己的缓存 ...
- CentOS 6.5 下Nginx服务的安装与配置
参考网站: http://www.cnblogs.com/zhuhongbao/archive/2013/06/04/3118061.html http://www.cnblogs.com/jilia ...
- CentOS 6.3下Samba服务器的安装与配置方法(图文详解)
这篇文章主要介绍了CentOS 6.3下Samba服务器的安装与配置方法(图文详解),需要的朋友可以参考下 一.简介 Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件, ...
- CentOS 6.3下rsync服务器的安装与配置[转]
CentOS 6.3下rsync服务器的安装与配置 一.rsync 简介 Rsync(remote synchronize)是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件,也 ...
随机推荐
- if判断比较详解
shell判断数组中是否包含某个元素: ary=(1 2 3) a=2 if [[ "${ary[@]}" =~ "$a" ]] ; then echo ...
- android:制作 Nine-Patch 图片
它是一种被特殊处理过的 png 图片,能够指定哪些区域可以被拉伸而 哪些区域不可以. 那么 Nine-Patch 图片到底有什么实际作用呢?我们还是通过一个例子来看一下吧.比如 说项目中有一张气泡样式 ...
- STM32 F103 F407 F429 F767对比图
- (转)Render Path
Render Path定义Render Path,就是采取的光照流程. Render Path设置可以在Edit-> Project Settings->Player 里设定,见下图.也可 ...
- 为什么用svg放弃了iconfont?
svg替代iconfont的好处(无论是基于Vue.Jquery),都推荐svg http://www.woshipm.com/pd/463866.html svg图标库,svg图标在线制作 http ...
- 微软BI 之SSIS 系列 - 导出数据到 Excel 2013 的实现
开篇介绍 碰到有几个朋友问到这个问题,比较共性,就特意写了这篇小文章说明一下如何实现在 SSIS 中导出数据到 Office Excel 2013 中.通常情况下 2013 以前的版本大多没有问题,但 ...
- linux 删除换行符
今天需要删除文件里面的换行符,比如有一个文件a.txt: 1,2,3 4,5,6 1,2,3 4,5,6 1,2,3 4,5,6 1,2,3 4,5,6 1,2,3 4,5,6 1.使用vim删除换行 ...
- 登录sqlplus 后,显示问号 ????
登录sqlplus 后,显示 ???? SYS@orcl>startup ORACLE instance started. Total System Global Area 3290345472 ...
- OpenCV 学习笔记 07 目标检测与识别
目标检测与识别是计算机视觉中最常见的挑战之一.属于高级主题. 本章节将扩展目标检测的概念,首先探讨人脸识别技术,然后将该技术应用到显示生活中的各种目标检测. 1 目标检测与识别技术 为了与OpenCV ...
- Keepalived源码安装
1.编译.安装 # tar -xvf keepalived-1.3.9.tar.gz # cd keepalived-1.3.9/ # ./configure -prefix=/usr/local/k ...