---
title: "linux-squid 配置安装"
author: "cfan_haifeng"
date: "2015-03-09T17:14:16Z"
tags: []
categories: ["操作系统"]
slug: "linux-squid"
draft: false
lastmod: "2015-03-12T15:14:19Z"
id: 2190682
url: "https://sunfish.iteye.com/blog/2190682"
---

由于工作原因不少同事需要访问[www.google.com](http://www.google.com/)，[http://www.facebook.com/](http://www.facebook.com/)。恰好收里又有一台相关服务器（CentOS release 5.10 (Final)），所以就决定做个代理服务器来解决这件事情了。步骤如下：

 

1.执行“rpm -qa|grep squid” 判断是否已经按照了squid。

2.如果没有，则执行“yum install squid”进行安装，我这里安装的版本是 Version 2.6.STABLE21

3.执行“service squid start”，但发现无法启动

4.执行“hostname”，发现为“MyServer”，所以在“/etc/squid/squid.conf” 的末尾添加“visible\_hostname MyServer”（没有"号），重启成功。

5.IE配置代理后发现无法访问，如"Access Denied."等。搜搜，打开“/etc/squid/squid.conf” ，注释掉"http\_access deny all"，并添加 

http\_port 3128 **#注意http\_port 这个也不要搞重复啊**

visible\_hostname MyServer

cache\_mgr 174438359@qq.com

acl all src 0.0.0.0/0.0.0.0

#never\_direct deny local-servers

#never\_direct allow all

http\_access allow all

 

6.重启ok