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.5安装nginx

    转载 xff1a http blog csdn net yinwenjie article details 46620711 2 Nginx的安装 2 1 准备工作 操作系统 xff1a centOS 6 5 Nginx的下载地址 xff1
  • Debian搭建Squid服务

    实验拓扑 实验要求 Server01 IP地址 172 16 100 201 25 网关 172 16 100 254 Server02 IP地址 192 168 10 3 28 网关 192 168 10 2 Rserver IP地址 1
  • 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
  • VM中安装Centos6.8详细步骤(图文)

    目录 1 检查BIOS虚拟化支持2 新建虚拟机3 新建虚拟机向导4 创建虚拟空白光盘5 安装Linux系统对应的CentOS版6 虚拟机命名和定位磁盘位置7 处理器配置 xff0c 看自己是否是双核 多核8 设置内存为2GB9 选择IO控制
  • CentOS-7.2部署Squid服务

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

    问题 xff1a nginx emerg socket 80 failed 97 Address family not supported by protocol 解决方案 vim etc nginx conf d default conf
  • 如何在 Debian 8 上安装和配置 Squid Proxy

    Squid 是类 Unix 操作系统上流行的代理服务器 它还用于网页过滤 它广泛用于通过缓存重复数据来提高 Web 服务器速度 本教程帮助您在 Debian 8 Jessie 系统上安装 Squid 代理服务器 还提供代理服务器的基本配置详
  • 如何在 Ubuntu 和 Debian 上设置 Squid 代理服务器

    如果您正在寻找一种增强 Debian 服务器安全性和性能的方法 那么设置 Squid 代理服务器可能是一个不错的选择 Squid 是一种广泛使用的开源代理服务器 提供缓存 过滤和身份验证等各种功能 在本文中 我们将讨论在 Ubuntu 和基
  • CentOS 6和Centos 7 虚拟机 关闭防火墙

    Centos 7 虚拟机 关闭防火墙 https blog csdn net preserveXing article details 127076756 CentOS 6 防火墙的关闭 关闭其服务即可 查看CentOS防火墙信息 etc
  • 如何在 Ubuntu 18.04 和 16.04 上设置 Squid 代理服务器

    Squid 是类 Unix 操作系统中最流行的代理服务器 它还用于网页过滤 Squid 还可用作 HTTP HTTPS 和 FTP 协议的缓存代理服务器 本文将帮助您在 Ubuntu 18 10 18 04 LTS 16 04 LTS 和
  • 升级到 G++ 4.8 - exception_ptr.h 不支持异常传播

    我正在尝试使用 g 4 8 重新编译一个巨大的遗留应用程序 以便调试glibc detected memory corruption问题 使用 AddressSanitizer 之前我们使用的是 g 4 4 7 但是 编译失败并显示 opt
  • SonarQube 以 143 退出

    我正在尝试在具有 6GB RAM 的 Centos 6 VM 上设置 SonarQube 该进程始终以 143 退出 经过分析 我发现 JVM 被发送了一个 SIGTERM 信号并因此退出 没有核心转储 dmesg 也没什么帮助 我也尝试摆
  • 如何验证用作反向代理的 Squid 是否正常工作?

    我们希望减少其中一台 Web 服务器的负载 并且正在使用配置为反向代理的鱿鱼运行一些测试 配置在下面的备注中 http port 80 accel defaultsite original server com cache peer ori
  • 未找到 GLIBCXX_3.4.15、GLIBC_2.15 和 GLIBC_2.14 - Centos 6.5

    我正在尝试运行一个应用程序 但我得到 usr lib64 libstdc so 6 VERSION GLIBCXX 3 4 15 not found lib64 libc so 6 VERSION GLIBC 2 15 not found
  • Squid - 监听多个端口并转发到不同的代理

    我想设置一个侦听多个端口的代理 每个端口将请求转发到不同的代理 例如 LISTEN FORWARD TO 1 2 3 4 3128 gt 5 6 7 8 3128 1 2 3 4 3129 gt 5 6 7 9 3128 1 2 3 4 3
  • git-http-backend 与 AuthzUnixGroup 无法正常工作

    我正在尝试在 CentOS 6 机器上的 Apache 2 2 上设置一个 git 存储库 并安装了 git 我尝试过许多不同的方向 但我却不知所措 我目前的情况包括能够clone正常 但完全无法推动 似乎我无法使身份验证位正常工作 因为我
  • 使用 yum 和 pear 安装 php-soap 均失败

    我正在尝试在 Centos 6 4 服务器上安装 PHP 的 SOAP 扩展 我对包管理器 从 CLI 安装包并在 PHP 中配置它们相当不熟悉 我相当有能力管理 php ini 和其他 PHP 配置文件 soap ini 等 我尝试使用以
  • 是否可以记录虚拟卡的输出?

    我正在尝试使用 dmix 和 dsnoop 通过虚拟卡混合音频文件 aplay s1 wav aplay s2 wav arecord f dat t wav d 3 result wav 但这可能吗 我只有虚拟卡 modprobe snd
  • 将 bash 脚本作为守护进程运行

    我有一个脚本 它每 X 次运行我的 PHP 脚本 bin bash while true do usr bin php f my script php echo Waiting sleep 3 done 我怎样才能将它作为守护进程启动 要从
  • Squid 可以在 nginx 后面运行吗?

    我正在尝试在 nginx 后面运行一个鱿鱼服务器 我这样配置 nginx server listen 8080 location proxy pass http localhost 3128 proxy set header Host ho

随机推荐

  • 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