Note! Linux based operating system must be installed on the server.
apt-get install squid
Open configuration file /etc/squid/squid.conf
and modify the necessary parameters.
http_access allow all
http_access deny all <-- add above this rule
Note! This rule must be above the rule
http_access deny all
cache_dir ufs /var/spool/squid 4096 32 256
ufs
– file system (the best choice for squid);/var/spool/squid
– cache storage directory;4096
– amount of space allocated for the cache (in MB);32
– first-level directories amount for the cache;256
– second-level directories amount for the cache.
http_port 1337
Create a new file /etc/squid/blacklist
and fill it with the domains that will be blocked:
r\.mradx\.net
tns\-counter\.ru
ad\.mail.ru
Open configuration file /etc/squid/squid.conf
and add the next rules:
acl url_filtred src all
acl blacklist url_regex -i "/etc/squid/blacklist"
http_access deny blacklist url_filtred
http_access allow all <-- add above this rule
Note! This rule must be above the rule
http_access allow all
Open configuration file /etc/squid/squid.conf
and add the next rules:
cache_peer <parent_proxy_IP> parent <port> 0 no-query default
acl all src 0.0.0.0/0.0.0.0
http_access allow all <-- add between this rule
never_direct allow all
Note! This rule must be between the rule
http_access allow all
/etc/init.d/squid stop
squid -z
/etc/init.d/squid start
crontab -e
0 4 * * * /etc/init.d/squid restart