Squid proxy
Установка, включая SQUID_DELAY_POOLS, SQUID_WCCP, SQUID_IDENT, SQUID_PF, SQUID_KQUEUE, SQUID_LARGEFILE
cd /usr/ports/www/squid/
make config
make install clean
rehash
squid -z
Конфиг там /usr/local/etc/squid/squid.conf
Добавляем в автозагрузку echo ‘squid_enable=»YES»‘ >> /etc/rc.conf
Запускаем /usr/local/etc/rc.d/squid start
Очистка кеша:
squid -k shutdown
rm -r /squid/cache/*
squid -z
/usr/local/etc/rc.d/squid start
Настройки для кеширующего сквида:
/usr/local/etc/squid/squid.conf
http_port 127.0.0.1:3128 transparent
icp_port 0
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 128 MB
maximum_object_size 8092 KB
maximum_object_size_in_memory 512 KB
cache_dir ufs /usr/local/squid/cache 2048 64 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
cache_mgr webmaster
visible_hostname mail.my_domain.ruerror_directory /usr/local/etc/squid/errors/Russian-1251
acl QUERY urlpath_regex cgi-bin \?
acl manager proto cache_object
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.0/8
acl our_networks src 10.0.0.0/24
acl denied_sites dstdomain ~/denied_sites.conf
http_access deny denied_sites
http_access allow our_networks
http_access allow localhost
http_access deny all
coredump_dir /usr/local/squid/cache
pid_filename /usr/local/squid/logs/squid.pid
Далее создаем папки, раздаем права и рестаритмся:
mkdir -p mkdir /var/log/squid
chown -R squid:wheel /var/log/squid/
touch ~/denied_sites.conf
/usr/local/etc/rc.d/squid stop
squid -z
/usr/local/etc/rc.d/squid start