Linux学习篇第三章之~squid

                     
---------------------------------squid---------------------------------
[root@foundation43 Desktop]# yum install squid -y   ##安装代理软件
[root@foundation43 Desktop]# systemctl start squid
[root@foundation43 Desktop]# vim /etc/squid/squid.conf
  acl badurl dstdomain .baidu.com  ##拒绝.baidu站点访问
  http_access deny badurl      
  http_access allow localnet
  http_access allow localhost
  http_access allow all   ##允许所以人访问
  cache_dir ufs /var/spool/squid  100 16 256  ##默认缓存目录 100M 16一级目录 256二级目录
[root@foundation43 Desktop]# systemctl restart squid  

测试
虚拟机打开 firefox 
>Edit
>preferences
>advanced
>network
>setting
>manual proxy configuration
>http proxy :172.25.254.43 port:3128
>ok

访问 www.baidu.com 

------------------------------反向代理-------------------------------------
1 重置desktop
2.yum install squid -y
systemctl start squid
3.vim /etc/squid/squid.conf

4.vim /etc/squid/squid.conf

  >http_access allow all

  # Squid normally listens to port 3128
  http_port 80 vhost vport
  cache_peer 172.25.254.124 parent 80 0 no-query originserver name=web1 round-robin
  cache_peer 172.25.254.121 parent 80 0 no-query originserver name=web2 round-robin
  cache_peer_domain www.westos.com web1 web2
  # Uncomment and adjust the following to add a disk cache directory.
  cache_dir ufs /var/spool/squid 100 16 256
systemctl restart squid
vim /etc/host
 172.25.254.143 www.westos.com
测试
www.westos.com























































  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值