centos6下安装与配置squid代理

2023-05-16

1.安装squid

yum install squid -y

2.编辑配置文件

vim /etc/squid/squid.conf
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1

# 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/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80      # http
acl Safe_ports port 21      # ftp
acl Safe_ports port 443     # https
acl Safe_ports port 70      # gopher
acl Safe_ports port 210     # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280     # http-mgmt
acl Safe_ports port 488     # gss-http
acl Safe_ports port 591     # filemaker
acl Safe_ports port 777     # 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 allow all     ##允许所有人使用代理

# Squid normally listens to port 3128
http_port 172.31.31.35:8080   ##代理内网ip与代理端口

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 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:       1440    20% 10080
refresh_pattern ^gopher:    1440    0%  1440
refresh_pattern -i (/cgi-bin/|\?) 0 0%  0
refresh_pattern .       0   20% 4320
auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/passwd     ##授权
acl auth_user proxy_auth REQUIRED   ##授权
http_access allow auth_user     ##授权

注:rpm -ql squid | grep ncsa_auth ##检测本机nsca_auth模块位置
3.检查参数是否有误

squid -k parse

4.设置缓存目录

squid -k parse

5.启动squid服务

service squid start

6.设置用户名与密码

htpasswd -c /usr/etc/squid/passwd user1
输入并确认密码

以及在配置文件中添加最后三行

重启squid服务:/etc/init.d/squid restart

注:htpasswd命令存在于apache中,可以通过yum insatll httpd来安装

7.在浏览器测试过程中,挂代理是使用公网ip地址与代理端口,并且确保

squid服务器,防火墙出处于关闭状态,selinux为disable。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

centos6下安装与配置squid代理 的相关文章

  • centos6 yum源失效解决方法

    今天看到服务器提示有漏洞需要更新 xff0c 在执行更新命令的时候一直报错 xff0c 因为CentOS 6操作系统版本结束了生命周期 xff08 EOL xff09 xff0c Linux社区已不再维护该操作系统版本 导致不能正常更新 x
  • CentOS6.8安装python3+ranger

    个人比较喜欢使用ranger做文件管理器用 xff0c 需要python3支持 CentOS6 8无法直接使用yum安装python3 xff0c 那我们就编译安装吧 xff01 准备工作 依赖 yum span class token f
  • 发挥Squid优势,TCP_HIT变成TCP_MEM_HIT

    192 168 10 139 15 Dec 2011 16 49 37 43 0800 34 GET http www jian com p w picpaths shufa jpg HTTP 1 0 34 200 95900 34 34
  • centOS6.5 安装mysql5.7最新版流程

    1检查是否已经安装mysql 指令 xff1a rpm qa grep MySQL rpm qa grep mysql root 64 mysql2 rpm qa grep MySQL MySQL python 1 2 3 0 3 c1 1
  • Debian squid配置

    Basic squid conf etc squid3 squid conf instead of the super bloated default config file auth param basic program usr lib
  • Centos squid配置

    squid配置 题目 一 关闭Selinux跟防火墙 二 安装squid服务 并启动 三 配置路由转发 提供路由功能 临时开启 永久开启 四 浏览器测试 打开火狐浏览器找到网络设置 提示 有任何问题可以私信我 下班看到第一时间回复 题目 s
  • CentOS-7.2部署Squid服务

    一 安装Squid代理服务器 yum y install squid 1 启动Squid服务和设置开机启动 systemctl start squid systemctl enable squid 2 详解Squid服务器配置文件 默认的
  • centos 6.x安装squid

    博客新址 http blog xuezhisd top 邮箱 xff1a xuezhisd 64 126 com 不设置用户认证 安装 安装 yum install squid yum install httpd 查看版本 rpm qa g
  • 配置最基础的linux系统——Centos6.x版本

    自然是用到虚拟机了 xff0c Vmware是我常用的 xff0c 这里建立一个虚拟的裸机很简单 xff0c 有两点是要说明的 1 最大磁盘大小 xff0c 这个默认的是最小大小 xff0c 不能设的别它还小了 xff0c 否则启动不了Ce
  • centos6和centos7的防火墙基本命令

    一 centos6 xff1a 1 firewall的基本启动 停止 重启命令 查看防火墙状态 xff1a service iptables status etc init d iptables status centos6启动 停止防火墙
  • centos6下安装与配置squid代理

    1 安装squid yum span class hljs keyword install span squid y 2 编辑配置文件 vim etc squid squid conf span class hljs preprocesso
  • centos6.5启动nginx报错

    问题 xff1a nginx emerg socket 80 failed 97 Address family not supported by protocol 解决方案 vim etc nginx conf d default conf
  • CentOS6.5上安装qt-creator-opensource-linux-x86-3.1.2.run

    1 qt creator opensource linux x86 3 1 2 run的下载 wget http mirrors hustunique com qt official releases qtcreator 3 1 3 1 2
  • 如何在 CentOS 6 上安装 ffmpeg

    我已经尝试安装 ffmpeg 2 天了 但没有成功 我在 youtube 上尝试了无数视频 在 google 上一步步尝试 但没有成功 任何帮助都会很棒 我有一台 Centos 6 服务器 是的 我在 mac 终端中使用 root ssh
  • 升级到 G++ 4.8 - exception_ptr.h 不支持异常传播

    我正在尝试使用 g 4 8 重新编译一个巨大的遗留应用程序 以便调试glibc detected memory corruption问题 使用 AddressSanitizer 之前我们使用的是 g 4 4 7 但是 编译失败并显示 opt
  • 通过 yum 安装 Fiware-Cygnus 时出错

    我正在尝试通过 yum 安装 Fireware Cygnus yum install cygnus ngsi 但中间我遇到了一些错误 Transaction Check Error file usr cygnus init d cygnus
  • centos 6 中gfortran编译器的安装

    我尝试安装一些编译器 我的笔记本电脑使用的是 Centos 6 我已经安装了 gcc 即 GNU C 编译器 我还需要安装 gfortran 但是当我输入时yum install gfortran 我收到消息no package gfort
  • PHP无法加载动态库'/usr/lib64/php/modules/module.so

    php version PHP 警告 PHP 启动 无法加载动态库 usr lib64 php modules module so usr lib64 php modules module so 无法打开共享对象文件 第 0 行的未知中没有
  • SonarQube 以 143 退出

    我正在尝试在具有 6GB RAM 的 Centos 6 VM 上设置 SonarQube 该进程始终以 143 退出 经过分析 我发现 JVM 被发送了一个 SIGTERM 信号并因此退出 没有核心转储 dmesg 也没什么帮助 我也尝试摆
  • 错误:php55w-common 与 CentOS 6.5 上的 php-common 冲突

    我已经安装了新的 64 位 CentOS 6 5 带有 PHP5 Mysql5 5 等 现在 当我想安装不同的 apache 模块 例如 php soap 时 我收到此错误 gt Package php soap x86 64 0 5 3

随机推荐

  • Mac 使用svn 报错:zsh:mac zsh: command not found: svn完整解决方案

    Mac 使用svn 报错 xff1a zsh xff1a mac zsh command not found svn完整解决方案 之前都是用的git xff0c 普遍也都是使用的git xff0c 但是为了应对各种项目 xff0c svn也
  • FreeRTOS数据类型和编程规范

    目录 数据类型 变量名 函数名 宏的名 数据类型 每个移植的版本都含有自己的portmacro h头文件 xff0c 里面定义了2个数据类型 TickType t FreeRTOS配置了一个周期性的时钟中断 xff1a Tick Inter
  • 软件工程考研复试速成 - 知识点精炼 - 背诵版

    针对于考研复试 软件工程 的面试问答 xff0c 一般都是抽查重点的概念问题 xff0c 所以本文对软件工程知识点进行重点的精炼 xff0c 力求节省准研究生们的复习时间 写这篇博客也是因为小编也在准备复试 xff0c 对学习的网课进行笔记
  • 如何将模型alembic与动画alembic相关联?

    在三维动画制作时 xff0c 许多制作部门需要同时进行 xff0c 当模型部门制作好模型之后会把publish好的模型分给材质 xff0c 动画 xff0c layout等部门同时进行制作 xff0c 有时候项目要求角色有不同的材质和UV
  • Cesium标注实体【Entity】增、删、改、查

    实体实例将多种形式的可视化聚合到一个高级对象中 它们可以手动创建并添加到 Viewer entities 或由数据源生成 xff0c 例如 CzmlDataSource 和 GeoJsonDataSource 一 Entity 增加 方法一
  • hdu1085(生成函数)

    题目 我终于会用对拍器了 xff0c 我总是不敢去尝试新事物 xff0c 去年就像学 xff0c 上网搜过几次资料 xff0c 感觉烦就放弃了 xff0c 但事实证明其实非常简单 xff0c 对于我未来的coding生活来说实在是大有裨益
  • sumo osmWebWizard.py不生成OSM.sumocfg

    osmWebWizard在确定地图范围和车辆数 xff0c 点击Generate Scenario选项后 生成文件只含有osm netccfg和osm polycfg xff0c 如图 xff1a 主要原因是 当前版本默认仅勾选Add Po
  • vue封装Axios

    Axios的封装 安装axios npm install axios span class token punctuation span span class token comment 安装axios span 引入 一般在项目的src目
  • docker学习笔记(一)—— ubuntu16.04下安装docker

    本文开发环境为Ubuntu 16 04 LTS 64位系统 xff0c 通过apt的docker官方源安装最新的Docker CE Community Edition xff0c 即Docker社区版 xff0c 是开发人员和小型团队的理想
  • Centos7 安装teamviewer

    需求 需要在centos7服务器上安装最新的centos7 一 前期准备 下载teamviewer安装包 xff1a teamviewer官网 使用xftp把下载的文件传到服务器对应的文件夹中 二 安装步骤 启动前准备环境 1 关闭防火墙
  • 字典序最大的子序列(维护单调栈)

    题意 xff1a 找到给出序列的字典序最大的子序列 思路 xff1a 维护单调栈即可 代码 xff1a span class token macro property span class token directive keyword i
  • C++(7-8章)笔记

    第七章 函数 C 43 43 的编程模块 7 xff0e 1函数 1 xff0c 函数如何返回值的 xff1f 答 xff1a 函数通过将返回值复制到指定的cpu寄存器或内存单元中来将其返回 随后 xff0c 调用程序将查看该内存单元 返回
  • 2020/2/20

    区域赛复现 xff1a 1小时 C 43 43 两章 xff1a 3小时 https www cnblogs com yrz001030 p 12340003 html 补了区域赛一题 xff1a 1小时 几何基础 43 2题 xff1a
  • 图论总结

    https www cnblogs com nervendnig p 9151437 html https www cnblogs com zhsl p 3271754 html
  • 使用栈实现进制转换

    使用栈实现进制转换 题目描述 使用栈将一个很长 xff08 gt 30 xff09 的十进制数转换为二进制数 分析 xff1a 此处虽然讲了用栈操作 xff0c 但是很明显我们可以不用 xff0c 直接用数组保存 当然用栈也一样 通过分析
  • 奇怪的棋盘

    题目描述 CC喜欢下棋 xff0c 她有一天去商店发现有很多很奇怪的棋盘 xff0c 那些棋盘的长宽不一样 xff0c 宽永远是2 xff0c 然后长有从1 n等等 然后那个商店还卖很奇怪的棋子 xff0c 都是1 2的大小 xff0c C
  • 萝卜的冒泡排序

    题目描述 萝卜上次已经说过要给各位同学出一道冒泡排序 xff0c 那么此题就以冒泡排序为主吧 xff0c 可是实验室的学长学姐觉得学弟学妹们都很厉害 xff0c 所以就加了各种各样的条件 xff0c 最 终萝卜还是选择加一些条件 xff0c
  • 直接插入排序

    直接插入排序 题目描述 利用直接插入排序算法实现线性表的排序 要求输出第k趟排序的结果 例如原来线性表为 xff1a 26 12 25 4 36 15 21 第一趟直接排序排序结果为 xff1a 12 26 25 4 36 15 21 xf
  • 习武之人

    题目描述 Edmondsiu用沙袋练习武术 Edmondsiu希望把沙袋摆在他家豪宅里面 Edmondsiu的豪宅有一个由11的地砖铺成的1n的院子里 Edmondsiu是处女座的 xff0c 所以他要把一个沙袋正好摆在一个地砖上 xff0
  • centos6下安装与配置squid代理

    1 安装squid yum span class hljs keyword install span squid y 2 编辑配置文件 vim etc squid squid conf span class hljs preprocesso