linux运维-squid
来源:互联网 发布:js代码攻击 编辑:程序博客网 时间:2024/05/16 12:47
1.squid正向代理
在真机进行操作:
yum install squid -y
vim /etc/squid/squid.conf
##acl badurl dst www.baidu.com ##访问不到www.baidu.com其他可以
##acl badurl dstdomain .baidu.com ##所有的.baidu.com都访问不到
##http_access deny badurl ##拒绝做badurl的代理
http_access allow localnet ##允许本机网络访问
http_access allow localhost ##允许本地主机访问
# And finally deny all otheraccess to this proxy
http_access allow all ##允许所有人通过http访问
# Squid normally listens to port3128
http_port 3128 ##端口号为3128
# Uncomment and adjust thefollowing to add a disk cache directory.
cache_dir ufs /var/spool/squid 10016 256 ##访问缓存
systemctl restart squid
测试:desktop
firefox->edit->preferences->advanced->network->setting->manual:http:172.25.254.22port:3128
2.squid反向代理
server:(关闭httpd服务)
yum install squid -y
vim /etc/squid/squid.conf
http_access allow all
cache_peer 172.25.254.122 parent80 0 no-query
# Squid normally listens to port3128
http_port 80 vhost vport
# Uncomment and adjust thefollowing to add a disk cache directory.
cache_dir ufs /var/spool/squid 10016 256
systemctl restart squid
测试:浏览器输入172.25.254.122可以访问到
\
3.squid访问多台服务器
server:
vim /etc/squid/squid.conf
http_access allow all
# Squid normally listens to port3128
http_port 80 vhost vport
cache_peer 172.25.254.122 parent80 0 no-query originserver name=web1 round-robin
cache_peer 172.25.254.122 parent80 0 no-query originserver name=web2 round-robin
cache_peer_domain www.westos.comweb1 web2
# Uncomment and adjust thefollowing to add a disk cache directory.
cache_dir ufs /var/spool/squid 10016 256
systemctl restart squid
vim /etc/hosts
172.25.254.122www.westos.com
- linux运维-squid
- Linux squid 安装配置
- linux 安装 squid 代理服务器
- Linux squid 缓存服务器
- Linux学习笔记 --Squid
- linux学习之squid
- linux下安装squid
- Linux系统squid服务
- Linux安装Squid
- linux+squid+iptables企业方案
- Linux下架设代理服务器squid
- linux配置iptables和squid
- 调整linux提高squid并发
- linux下配置squid代理服务器
- linux+squid+iptables企业级解决方案
- Linux下配置Squid基础教程
- linux下安装squid代理服务器
- linux https代理squid搭建
- 进程间通信之管道
- C++ scanf()输入string类型变量
- Flutter进阶—实现动画效果(二)
- 【C++】操作符重载及实现简单的复数类Complex
- Docker和k8的基本操作
- linux运维-squid
- 1.3 基于对话框的MFC应用程序实例
- Java编程思想-18Java I/O系统
- 【共勉】Hi,别总低头写代码!请查收你的新人指导...
- 显性的调用构造函数(感觉没太大用处)
- SVN 第一次提交代码
- git工具使用
- nginx启用HSTS以支持从http到https不通过服务端而自动跳转
- 测试