网站首页 > 技术文章 正文
squid 正向代理服务器配置100MB 宽带能跑出200MB 效果,云主机想探索外面世界,经费有限想提速,squid 是理想配置
安装dockerhub
https://hub.docker.com/r/ubuntu/squid
创建docker容器
docker run -d --name squid-container -e TZ=Asia/Shanghai -p 3128:3128 ubuntu/squid
进入容器
docker exec -it squid-container /bin/bash
安装编辑vim
apt update && apt install vim
编辑配置文件
vim /etc/squid/squid.conf
修改 http_port 3128 为 http_port 0.0.0.0:3128
修改 http_access deny all 为 http_access allow all
退出容器并且重启容器
exit && docker restart squid-container
配置完成以上配置后浏览器配置代理端口3128 基本可以上网,
以下为squid 配置账户密码。
进入容器
docker exec -it squid-container /bin/bash
查看认证配置路径
dpkg -L squid|grep ncsa
安装认证 htpasswd
apt-get install http-tools
添加账户
htpasswd -c /etc/squid/passwd 用户名
修改配置文件 /etc/squid/squid.conf
####/usr/lib/squid/basic_ncsa_auth 此处填写路劲为dpkg -L squid|grep ncsa 看到路径请保持一致否则验证失败####
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
# ncsa user on
acl ncsa_users proxy_auth REQUIRED
# permit ncsa
http_access allow ncsa_users
# deny permit
http_access deny all
猜你喜欢
- 2024-10-14 Ubuntu19.10系统的软件安装与卸载命令
- 2024-10-14 VMware下安装VMware tools,安装文件没有出现问题的解决
- 2024-10-14 大白话 linux 教程-09-安装和卸载软件包
- 2024-10-14 ubuntu下安装ssh(ubuntu下安装windows10)
- 2024-10-14 蓝易云 - Ubutun开机黑屏解决方法
- 2024-10-14 银河麒麟系统密码忘记了,修改密码和微信安装方法
- 2024-10-14 ubuntu离线apt-get更新源(ubuntu 离线升级)
- 2024-10-14 树莓派安装opencv3.4.0遇到的坑(树莓派安装opencv完整过程)
- 2024-10-14 linux 系统 没有 ifconfig 命令,提示: ifconfig: command not found
- 2024-10-14 go get 命令一直下载不了源站的包解决方案
- 02-21走进git时代, 你该怎么玩?_gits
- 02-21GitHub是什么?它可不仅仅是云中的Git版本控制器
- 02-21Git常用操作总结_git基本用法
- 02-21为什么互联网巨头使用Git而放弃SVN?(含核心命令与原理)
- 02-21Git 高级用法,喜欢就拿去用_git基本用法
- 02-21Git常用命令和Git团队使用规范指南
- 02-21总结几个常用的Git命令的使用方法
- 02-21Git工作原理和常用指令_git原理详解
- 最近发表
- 标签列表
-
- cmd/c (57)
- c++中::是什么意思 (57)
- sqlset (59)
- ps可以打开pdf格式吗 (58)
- phprequire_once (61)
- localstorage.removeitem (74)
- routermode (59)
- vector线程安全吗 (70)
- & (66)
- java (73)
- org.redisson (64)
- log.warn (60)
- cannotinstantiatethetype (62)
- js数组插入 (83)
- resttemplateokhttp (59)
- gormwherein (64)
- linux删除一个文件夹 (65)
- mac安装java (72)
- reader.onload (61)
- outofmemoryerror是什么意思 (64)
- flask文件上传 (63)
- eacces (67)
- 查看mysql是否启动 (70)
- java是值传递还是引用传递 (58)
- 无效的列索引 (74)