您的位置:首页 > 运维架构 > 反向代理

使用squid架设自己的代理服务器

2014-06-01 21:52 323 查看
主要参考了
http://blog.chinaunix.net/uid-20778906-id-540115.html
Ubuntu下Squid代理服务器的安装与配置

1 安装

$ sudo apt-get install squid

安装完了之后,发现安装的是squid3。

查看位置

# whereis squid3

squid3: /usr/sbin/squid3 /etc/squid3 /usr/lib/squid3 /usr/share/squid3 /usr/share/man/man8/squid3.8.gz

2 修改配置

配置文件是/etc/squid3/squid.conf

找到这里的位置

# Example rule allowing access from your local networks.

# Adapt to list your (internal) IP networks from where browsing

# should be allowed

添加一下规则,表示允许指定ip访问。

acl linger src 10.17.49.145#这是我客户端机器的局域网的ip地址

http_access allow linger

http_access deny all

设置监听端口

# Squid normally listens to port 3128

#http_port 3128

http_port 10.17.49.138:808#这个ip是服务器的局域网ip地址,端口可以是任意未使用的即可。

3 使配置生效

之前安装了,squid会自动运行。要使配置生效必须关掉。

squid3 -k shutdown

然后执行一下命令

squid3 -z

/etc/init.d/squid3 reload  

/etc/init.d/squid3
restart   

squid3
-k parse

最后,配置一下客户端机器的代理就可以了。

相关资料:
http://hi.baidu.com/pplboy/item/fe6d1e41b44d0514886d10e0
# tail -f /var/log/squid/access.log | awk '{print$3 " " $8 " " $7}'

监测Squid日志的五种方法
http://blog.csdn.net/forgotaboutgirl/article/details/6865641
Linux下架设代理服务器
http://www.enet.com.cn/article/2007/0724/A20070724737913.shtml
简单实用 教您在LINUX中架设代理服务器
http://blog.chinaunix.net/uid-7354475-id-2643362.html
linux 代理服务器安装配置!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: