squid

网友投稿 290 2022-10-25


squid

######################squid#######################

[root@foundation75 Desktop]# yum install -y squid

[root@foundation75 Desktop]# systemctl start squid

[root@foundation75 Desktop]# netstat -antlpe | grep squid

tcp6       0      0 :::3128                 :::*                    LISTEN      0          89631      7155/(squid-1)

[root@foundation75 Desktop]# vim /etc/squid/squid.conf

58 allow all                 ##允许所有主机访问

64 cache_dir ufs /var/spool/squid 100 16 256

[root@foundation75 Desktop]# systemctl restart squid.service

测试

[root@foundation75 Desktop]# vim /etc/squid/squid.conf

52 acl badurl dstdomain .baidu.com

53 deny badurl            ##禁止baidu访问,但其他可以访问

54 allow localnet

55 allow localhost

56

57 # And finally deny all other access to this proxy

58 deny all

64 #cache_dir ufs /var/spool/squid 100 16 256

[root@foundation75 Desktop]# systemctl restart squid.service

测试

###############cdn反向加速##########

cdn反向加速原理:建立一个反向代理节点,客户端需要什么东西,直接访问代理节点,代理节点去服务端获取并进行缓存,这样就间接性的从服务端获取了信息,并且获取速度比较快

yum install -y squid

systemctl start  squid

systemctl stop firewalld

netstat -antple | grep squid

vim /etc/squid/squid.conf

# And finally deny all other access to this proxy

56 allow all

57

58 # Squid normally listens to port 3128

59 80 vhost vport

60 cache_peer 172.25.254.136 parent 80 0 no-query

systemctl restart squid

#############平分主机访问的压力########

vim /etc/squid/squid.conf

# And finally deny all other access to this proxy

allow all

# Squid normally listens to port 3128

80 vhost vport

cache_peer 172.25.254.111 parent 80 0 no-query originserver name=web1 round-robin weight=3

cache_peer 172.25.254.124 parent 80 0 no-query originserver name=web2 round-robin weight=1

cache_peer_domain westos.com web1 web2


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java 实现LZ78压缩算法的示例代码
下一篇:C++中的继承和组合区别使用
相关文章

 发表评论

评论列表