wiki'd

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 10.20.30.40 -l 127.0.0.1 mgr:info

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

/etc/squid/squid.conf

http_port 10.20.30.40:80 accel defaultsite=jokeru.ro vhost
forwarded_for on
cache_peer 50.60.70.80 parent 80 0 no-query no-digest originserver login=PASS name=RealServer
icp_port 0

acl ALL src 0.0.0.0/0.0.0.0
acl Manager proto cache_object
acl LocalHost src 127.0.0.1/255.255.255.255
acl JoKeru dstdomain jokeru.ro www.jokeru.ro

# 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
snmp_incoming_address 10.0.0.2
acl CactiIP src 10.0.0.1/32
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
cache_mgr webmaster@jokeru.ro

Comments