Linux网络代理服务器搭建及使用
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
- 测试环境:
- 代理服务器:centos 7
- 使用代理的客户端:win 10
- 搭建代理服务器
centos安装代理软件:squid
yum install squid -y
yum install httpd-tools -y
创建账户密码文件
mkdir /etc/squid/
htpasswd -cd /etc/squid/passwords your_username
#提示输入密码,比如输入!@#$%- -!gagaga
ok
#按ctrl+c退出
接下来重中之重,修改配置文件,首先打开配置文件(也可用vi)
vim /etc/squid/squid.conf
因为要是验证用户名密码才能使用我们的代理服务器,所以这里要在最后一行再增加很多很多行- -,如下。
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwords
acl auth_user proxy_auth REQUIRED
http_access allow auth_user
cache_mem 64 MB
maximum_object_size 4 MB
minimum_object_size 0 KB
maximum_object_size_in_memory 4096 KB
cache_dir ufs /var/spool/squid 100 16 256
cache_log /var/log/squid/cache.log
access_log /var/log/squid/access.log
logfile_rotate 60
cache_swap_high 95
cache_swap_low 90
# Hide client ip #
forwarded_for delete
# Deny request for original source of a request
follow_x_forwarded_for deny all
# See below
request_header_access X-Forwarded-For deny all
request_header_access Via deny all
http_port 0.0.0.0:(your port不要复制粘贴哦!)
visible_hostname squid.packet-pushers.net
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
记得要注释这些行
#http_access allow localnet
#http_access allow localhost
类似这些的东东
作为IT人员,我们严谨的做一下“单元测试”,看看配置文件有没有问题,终端输入指令:squid -k parse
如果没问题是不会报错的,如下
2020/03/20 14:23:12| Startup: Initializing Authentication Schemes ...
2020/03/20 14:23:12| Startup: Initialized Authentication Scheme 'basic'
2020/03/20 14:23:12| Startup: Initialized Authentication Scheme 'digest'
2020/03/20 14:23:12| Startup: Initialized Authentication Scheme 'negotiate'
2020/03/20 14:23:12| Startup: Initialized Authentication Scheme 'ntlm'
2020/03/20 14:23:12| Startup: Initialized Authentication.
……#省略了n行- -
OK,既然没问题,那就开启代理服务器吧!
#(停止为stop)
systemctl start squid.service
#开机自启动
systemctl enable squid.service
- 客户端使用代理服务器
打开浏览器的internet属性选项,如下设置之后就可以使用代理服务器上网喽(当然还会弹出窗口,让您输入用户名密码)
推荐内容
阅读全文
AI总结




A beautiful web dashboard for Linux
最近提交(Master分支:7 个月前 )
186a802e
added ecosystem file for PM2 5 年前
5def40a3
Add host customization support for the NodeJS version 5 年前
更多推荐
相关推荐
查看更多
linux-dash

A beautiful web dashboard for Linux
linux-dash

A beautiful web dashboard for Linux
linux-dash

热门开源项目
活动日历
查看更多
直播时间 2025-04-25 15:00:00


直播时间 2025-04-23 19:00:00

GitTalk:国内首个微服务编排框架Juggle实战解析
直播时间 2025-04-22 18:31:56

字节AI 黑科技!从 Manus Agent 入门 Eino
直播时间 2025-04-09 14:34:18

樱花限定季|G-Star校园行&华中师范大学专场
直播时间 2025-04-07 14:51:20

樱花限定季|G-Star校园行&华中农业大学专场
所有评论(0)