Linux下配置squid http proxy

操作系统:CentOS 5.5
1)首先检查服务器是否安装了squid:

which squid

2)yum安装squid:

yum install squid

3)修改squid.conf参数:

vi  /etc/squid/squid.conf

加入如下参数:

dns_nameservers 8.8.8.8
http_port 8000
http_access allow all 
cache_mem 60 MB
visible_hostname redicecn.com

4)创建squid交换目录:

cd /usr/sbin/
./squid -z

5)启动squid、查看端口状态:

./squid
netstat -ntl

6)测试:
在浏览器中设置代理:IP(squid主机的IP),端口(8000,http_port参数)

PS:如何停止squid?

./squid -k shutdown

来源:https://my.oschina.net/cppblog/blog/17303