by JoKeru

Squid as a Reverse Proxy (Website Accelerator)

$ yum install squid

$ vi /etc/sysconfig/squid
$ vi /etc/squid/squid.conf
$ service squid restart

$ tail -f /var/log/squid/access.log | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'
$ squidclient -p 80 -h -l mgr:info

# Create swap directories
$ service squid stop; squid -z; service squid start


http_port accel vhost
forwarded_for on
cache_peer parent 80 0 no-query no-digest originserver login=PASS name=RealServer
icp_port 0

acl ALL src
acl Manager proto cache_object
acl LocalHost src
acl JoKeru dstdomain

# allow cachemgr access only from localhost
http_access allow Manager LocalHost
http_access deny Manager
# allow everybody access to site
http_access allow JoKeru
# deny all not matching the above
http_access deny ALL

cache_peer_access RealServer allow JoKeru

snmp_port 3401
acl CactiIP src
acl CactiCom snmp_community secret
snmp_access allow CactiIP CactiCom
snmp_access deny ALL

# MEM Size - 256 MB
cache_mem 256 MB
maximum_object_size_in_memory 32 KB
# SWAP Size - 512 MB
cache_dir aufs /var/spool/squid 512 16 256
maximum_object_size 4096 KB

access_log /var/log/squid/access.log squid