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 代理服务器 的 安装与配置的更多相关文章

  1. CentOS 6.4下Squid代理服务器的安装与配置,反向代理

    CentOS 6.4下Squid代理服务器的安装与配置 一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件 ...

  2. 【转载】CentOS 6.4下Squid代理服务器的安装与配置

    一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件,其接收用户的下载申请,并自动处理所下载的数据.当一个用 ...

  3. CentOS 6.4下Squid代理服务器的安装与配置

    一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件,其接收用户的下载申请,并自动处理所下载的数据.当一个用 ...

  4. [转]CentOS 6.4下Squid代理服务器的安装与配置

    一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件,其接收用户的下载申请,并自动处理所下载的数据.当一个用 ...

  5. CentOS 6.4下Squid代理服务器的安装与配置(转)

    add by zhj: 其实我们主要还是关注它在服务器端使用时,充当反向代理和静态数据缓存.至于普通代理和透明代理,其实相当于客户端做的事,和服务端没有什么关系.另外,Squid的缓存主要是缓存在硬盘 ...

  6. CentOS 6.5下Squid代理服务器的安装与配置

    1.1   缓存代理概述 作为应用层的代理服务器软件,squid主要提供缓存加速,应用层过滤控制的功能. 1.  代理的工作机制 当客户机通过代理来请求web页面时,指定的代理服务器会先检查自己的缓存 ...

  7. CentOS 6.5 下Nginx服务的安装与配置

    参考网站: http://www.cnblogs.com/zhuhongbao/archive/2013/06/04/3118061.html http://www.cnblogs.com/jilia ...

  8. CentOS 6.3下Samba服务器的安装与配置方法(图文详解)

    这篇文章主要介绍了CentOS 6.3下Samba服务器的安装与配置方法(图文详解),需要的朋友可以参考下   一.简介  Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件, ...

  9. CentOS 6.3下rsync服务器的安装与配置[转]

    CentOS 6.3下rsync服务器的安装与配置   一.rsync 简介 Rsync(remote synchronize)是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件,也 ...

随机推荐

  1. json字符串转换对象的方法1

    为了方便读者了解json的使用,读者直接粘贴下面代码看效果即可: var json1 = {'name':'小李','age':'11','sex':'女'};console.log(json1.na ...

  2. VirtualBox 扩展包卸载或安装失败(VERR_ALREADY_EXISTS)(转)

    文章出处:http://blog.csdn.net/leshami/article/details/9232229 最近在卸载VirtualBox出现了无法卸载的错误.提示为Failed to ins ...

  3. redis源码分析

    我阅读的源码版本是redis-2.8.19 src目录下总共96个.h,.c文件 1. 数据结构相关源码(15个左右)字符串代码: sds.h, sds.c字典:dict.h, dict.c链表: a ...

  4. 绘图 Painter转接口封装的方式

        记录下思想 适用于业务逻辑相对单纯的一些画法,比如画背景(颜色,背景,边框等) 一个Draw方法中如果绘制比较复杂的话,就会导致代码混乱,而不灵活,每次需求更改就得重新画过,可重用性差. 以接 ...

  5. iOS-获取当前时间的年、月、日、时、分、秒

    //获取当前时间02    NSDate *now = [NSDate date];03    NSLog(@”now date is: %@”, now);0405    NSCalendar *c ...

  6. Java HashSet工作原理及实现

    1. 概述 This class implements the Set interface, backed by a hash table (actually a HashMap instance). ...

  7. 奇怪吸引子---LiuChen

    奇怪吸引子是混沌学的重要组成理论,用于演化过程的终极状态,具有如下特征:终极性.稳定性.吸引性.吸引子是一个数学概念,描写运动的收敛类型.它是指这样的一个集合,当时间趋于无穷大时,在任何一个有界集上出 ...

  8. IOS Using UIAlertView to show alerts

    UIAlertView in other words, it's a dialog box. You want to show a message or ask user to confirm an ...

  9. flex bison

    https://www.gnu.org/software/bison/manual/bison.html https://blog.csdn.net/sirouni2003/article/detai ...

  10. Android中windowTranslucentStatus与windowTranslucentNavigation的一些设置(转)

    在iOS中,你可能发现页面会整体拉升到状态栏,整个页面效果就会显得更加的高端大气上档次,在Android4.4以后其实也有这种效果的实现,下面我就说一下在进行这种效果实现时碰到的一些坑,希望对大家有一 ...