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快速同步多台主机间的文件,也 ...
随机推荐
- 应用通信-方案二:Feign
------------------客户端controller层--------------------- @RestController public class ClientFeignContro ...
- python:函数中五花八门的参数形式(茴香豆的『回』字有四种写法)
毫不夸张的说,python语言中关于函数参数的使用,是我见过最为灵活的,随便怎么玩都可以,本文以数学乘法为例,演示几种不同的传参形式: 一.默认参数 def multiply1(x, y): retu ...
- web架构延变
在现代的软件系统中,几乎所有的系统都使用到了数据库,不论是关系型数据,例如MySql.SQLite.Oracle.SQLServer等,还是非关系性数据,例如mongoDB.redis等.本文已web ...
- java try-with-resource语句使用
定义 JDK7之后,Java多了个新的语法:try-with-resources语句, 可以理解为是一个声明一个或多个资源的 try语句(用分号隔开), 一个资源作为一个对象,并且这个资源必须要在执行 ...
- org.hibernate.QueryException: JPA-style positional param was not an integral ordinal; nested exception is java.lang.IllegalArgumentException: org.hibernate.QueryException: JPA-style positional param w
org.hibernate.QueryException: JPA-style positional param was not an integral ordinal; nested excepti ...
- LM && NTLM && ophcrack && RainBow table
Windows密码的加密方式:Windows 主要使用以下两种(包含但不限于)算法对用户名和密码进行加密:分 别是LanManager(LM)和NTLM,LM只能存储小于等于14个字符的密码hash, ...
- Kafka:ZK+Kafka+Spark Streaming集群环境搭建(三十):使用flatMapGroupsWithState替换agg
flatMapGroupsWithState的出现解决了什么问题: flatMapGroupsWithState的出现在spark structured streaming原因(从spark.2.2. ...
- JSON.parse 必须用双引号包起来
Why is it that whenever I do :- JSON.parse('"something"') it just parses fine but when I d ...
- VMware相关服务启动关闭脚本
VMware相关服务 VMware Authonrization Service:用于启动和访问虚拟机的授权和身份验证服务 VMware DHCP Service: IP自动分配协议——它不启动 虚拟 ...
- (亲测解决)每次打开excel文件都会出现两个窗口,一个是空白的sheet1,另一个是自己的文档
版权声明:本文为博主原创文章,转载请注明出处! https://blog.csdn.net/sinat_34104446/article/details/80210424 一.问题描述每次打开Exce ...