http_port 3128 transparent
hierarchy_stoplist cgi-bin ? dll aspx
acl QUERY urlpath_regex cgi-bin \? dll aspx
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 128 MB
maximum_object_size 8192 KB
#cache_dir savemethod cachedirectory harddiskspaceforcaching numberofdirectoryinlayer1 numberofdirectoryinlayer2
cache_dir diskd /cache/1 10000 16 256 Q1=256 Q2=150
cache_dir diskd /cache/2 10000 16 256 Q1=256 Q2=150
cache_dir diskd /cache/3 10000 16 256 Q1=256 Q2=150
cache_dir diskd /cache/4 10000 16 256 Q1=256 Q2=150
access_log /usr/local/squid/var/logs/access.log squid
allow_underscore on
#emulate_http_log on #for using other software like webalayzer
#cache_effective_user nobody
#cache_effective_group nobody
#acl name type data
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 to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
follow_x_forwarded_for allow localhost
follow_x_forwarded_for deny all
acl_uses_indirect_client on
delay_pool_uses_indirect_client on
log_uses_indirect_client on
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl our_networks src 192.168.40.0/24
http_access allow our_networks
http_access allow localhost
http_access deny all
http_reply_access allow all
icp_access allow all
#icp_port //work with other squid
cache_mgr
mohammadlinux@gmail.com
visible_hostname CacheServer
httpd_accel_no_pmtu_disc on
logfile_rotate 1
coredump_dir /usr/local/squid/var/cache
ie_refresh on
acl snmppublic snmp_community public
snmp_access allow snmppublic localhost
snmp_access deny all
cache_dns_program /usr/local/squid/libexec/dnsserver
dns_children 10
positive_dns_ttl 12 hours
مراقب باشید که تنظیمات مربوط به شبکتون رو توی اون باید تغییر بدین برای کمک میتونید از مقاله زیر کمک بگیرید
نصب و پیکربندی Squid
دستورات بعدی:
mkdir /usr/local/squid/var/cache
mkdir /cache
chown nobody:nobody /cache
chown nobody:nobody /usr/local/squid/var/logs
chown nobody:nobody /usr/local/squid/var
chmod +x /etc/rc.d/rc.squid
echo /usr/local/squid/sbin/squid -z >>/etc/rc.d/rc.local
echo /etc/rc.d/rc.squid start >>/etc/rc.d/rc.local
/etc/rc.d/rc.local
برای اجرای اون از دستور زیر میتونید استفاده کنید
/etc/rc.d/rc.squid start
اگر فایل رو تغییر دادید و خواستید فایل کانفیگ رو لود کنید دستور زیر رو وارد کنید
/usr/local/squid/sbin/squid -z
فرستادن درخواست های مورد نظر, به squid
iptables -t nat -A PREROUTING -s 192.168.9.0/24 -p TCP --dport 80 -j REDIRECT --to 3128