Linux建立代理服务器

1.    什么是代理服务器?

举个例子来说:比如A服务器需要访问B服务器,A可以直接访问B服务器,假如现在B服务器现在做了限制,只让C服务器可以访问他,此时A访问B时先可以先访问C,由C服务器来访问B服务器,将所得到的数据再返回A

2.    搭建环境

我使用的是squid工具,

1)    在linux上使用yum install squid就可以安装

2)    修改配置文件vi /etc/squid/squid.conf

将http_access deny all修改为http_access allow all,此时便可以使用代理了,(关于在浏览器中配置代理后面会详细讲到)

3)    指定固定ip可以代理,使用acl

http_access allow mytest

acl mytest src 223.21.146.148/29

4)    http_port

代理的端口号,默认为3128。

5)    启动

/etc/init.d/squid start

3.    浏览器配置,(以firefox为例)

选择Tools -> Options -> Advanced -> Network,填入代理服务器的IP,如下截图,保存后就可以使用代理服务器上网了

8d8e03cdgx6DAL8arGg78&690

 

代理服务器详细及更多配置请参见:http://blog.s135.com/book/squid/chap06.html

 

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>