squid | 10.0.0.41 |
---|---|
web1 | 10.0.0.42 |
web2 | 10.0.0.43 |
1, the installation squid
yum -y install squid
2, squid configuration modification, setting the polling load
vim /etc/squid/squid.conf
http_access allow all # Allow all access
http_access allow all #允许所有的访问
http_port 80 vhost vport
cache_peer 10.0.0.42 parent 80 0 proxy-only no-query originserver round-robin name=web1
cache_peer 10.0.0.43 parent 80 0 proxy-only no-query originserver round-robin name=web2
cache_peer 10.0.0.42 parent 80 0 no-query ## cache_peer: caching policy; 10.0.0.41 (the server IP, the cache server allows clients to view); parent: no backup agents; 80: server port 80; 0 : no spare port; proxy-only representation purposes only agent, no-query: no spare proxy, name just a title just
3 start
systemctl start squid
Second, the configuration web1, web2
web1
yum -y install httpd
echo 'web one'>/var/www/html/index.html
systemctl start httpd
web2
yum -y install httpd
echo 'web tow'>/var/www/html/index.html
systemctl start httpd
test
success