(a) Squid
Installation
Java code
- # yum Install Httpd-tools-y
- # htpasswd-c-b/etc/squid/passwords squiduser 123456
- # yum Install Squid-y
Set up
Java code
- # Cp/etc/squid/squid.conf/etc/squid/squid.conf.bak
- # vi/etc/squid/squid.conf
- Auth_param Basic Program/usr/lib64/squid/ncsa_auth/etc/squid/passwords
- Auth_param Basic Realm Proxy
- ACL authenticated Proxy_auth REQUIRED
- Http_access Allow authenticated
- Forwarded_for Delete
- Http_port 0.0. 0.0:3128
Start the service
Java code
- #/etc/init.d/squid Start
(ii) Varnish
Installation
Java code
- # RPM--nosignature-i https://repo.varnish-cache.org/redhat/varnish-4.0.el6.rpm
- # Yum Install-y Varnish
- # varnishd-v
Set up
Java code
- # Vi/etc/sysconfig/varnish
- varnish_listen_port=6081
- # vi/etc/varnish/DEFAULT.VCL
- Backend Default {
- . Host = "127.0.0.1";
- . Port = "81";
- }
- # varnishd-c-f/etc/varnish/default.vcl
Start the service
Java code
- # Service Varnish Start
- # service VARNISHNCSA Start
- # service Varnishlog Start
Confirm
Java code
- # Varnishadm Backend.list
Build CentOS 6 Server (+)-squid, Varnish