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快速同步多台主机间的文件,也 ...
随机推荐
- Oracle层次查询和分析函数在号段选取中的应用
转自:http://www.itpub.net/thread-719692-1-1.html 摘要一组连续的数,去掉中间一些数,如何求出剩下的数的区间(即号段)?知道号段的起止,如何求出该号段内所有的 ...
- linux最大进程数、最大打开文件数
ulimit 是一种 linux 系统的内键功能,它具有一套参数集,用于为由它生成的 shell 进程及其子进程的资源使用设置限制.本文将在后面的章节中详细说明 ulimit 的功能,使用以及它的影响 ...
- react-native ES5与ES6写法对照表
转载链接:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/react-native-es5-and-es6-writing-tabl ...
- Linux 操作 oracle 数据库
1.Oracle监听启动命令:lsnrctl start 2. sqlplus 登录数据库 3.OS版本及Oracle版本 select banner from v$version; 4.查询该数 ...
- Servlet第五课:Cookie的使用
目标规划: 通过这一节课,我们能够懂得怎样使用Cookie.以及怎样获取Cookie中的内容. 插播广告:博客之星评选.点击投我一票.谢谢. Cookie的具体概述. 1. Cookie 是保存在cl ...
- SpringMVC加载配置Properties文件的几种方式
最近开发的项目使用了SpringMVC的框架,用下来感觉SpringMVC的代码实现的非常优雅,功能也非常强大, 网上介绍Controller参数绑定.URL映射的文章都很多了,写这篇博客主要总结一下 ...
- 奇怪吸引子---Lorenz
奇怪吸引子是混沌学的重要组成理论,用于演化过程的终极状态,具有如下特征:终极性.稳定性.吸引性.吸引子是一个数学概念,描写运动的收敛类型.它是指这样的一个集合,当时间趋于无穷大时,在任何一个有界集上出 ...
- C++并发编程 条件变量 condition_variable,线程安全队列示例
1. 背景 c++11中提供了对线程与条件变量的更好支持,对于写多线程程序方便了很多. 再看c++并发编程,记一下学习笔记. 2. c++11 提供的相关api 3.1 wait wait用于无条件等 ...
- 【GPU编解码】GPU硬解码---DXVA (转)
前面介绍利用NVIDIA公司提供的CUVID库进行视频硬解码,下面将介绍利用DXVA进行硬解码. 一.DXVA介绍 DXVA是微软公司专门定制的视频加速规范,是一种接口规范.DXVA规范制定硬件加速解 ...
- 微信nickname乱码(emoji)及mysql编码格式设置(utf8mb4)解决的过程
转:https://segmentfault.com/a/1190000004594385 项目中涉及保存微信的nickname,之前一直正常使用,但是突然遇到一个之前没有遇到的问题.经过调试发现错误 ...