This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
установка_настройка_и_запуск_пакета_squid [2020/08/22 15:03] val [Debian/Ubuntu] |
установка_настройка_и_запуск_пакета_squid [2024/11/21 14:18] (current) val [Использование для кеширования] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Установка, настройка и запуск пакета SQUID ====== | ====== Установка, настройка и запуск пакета SQUID ====== | ||
- | [[http://ru.wikipedia.org/wiki/Squid]] | + | * [[https://www.oreilly.com/library/view/squid-the-definitive/0596001622/re91.html|shutdown_lifetime]] |
===== Установка ===== | ===== Установка ===== | ||
- | |||
- | ==== FreeBSD ==== | ||
- | <code> | ||
- | [gate:~] # pkg install squid | ||
- | |||
- | [gate:~] # rehash | ||
- | |||
- | [gate:~] # cd /usr/local/etc/squid/ | ||
- | </code> | ||
==== Debian/Ubuntu ==== | ==== Debian/Ubuntu ==== | ||
Line 20: | Line 11: | ||
<code> | <code> | ||
root@gate:~# apt install squid | root@gate:~# apt install squid | ||
- | |||
- | root@gate:~# cd /etc/squid/ | ||
</code> | </code> | ||
+ | ===== Настройка ===== | ||
+ | ==== Debian/Ubuntu ==== | ||
+ | <code> | ||
+ | gate# cat /etc/squid/conf.d/my.conf | ||
- | ===== Настройка ===== | + | ИЛИ |
- | ==== Debian/Ubuntu/FreeBSD ==== | + | gate# cat /etc/squid/squid.conf |
- | <code> | + | |
- | gate# cat squid.conf | + | |
</code><code> | </code><code> | ||
... | ... | ||
Line 38: | Line 29: | ||
acl our_networks src 192.168.X.0/24 | acl our_networks src 192.168.X.0/24 | ||
http_access allow our_networks | http_access allow our_networks | ||
- | ... | ||
- | # For FreeBSD | ||
- | # cache_dir ufs /var/squid/cache 3000 256 256 | ||
- | # For Debian/Ubuntu | ||
- | # cache_dir ufs /var/spool/squid 3000 256 256 | ||
- | # maximum_object_size 128 MB | ||
- | # !!! Need squid -z | ||
... | ... | ||
</code> | </code> | ||
Line 50: | Line 34: | ||
===== Тестирование конфигурации и запуск ===== | ===== Тестирование конфигурации и запуск ===== | ||
- | ==== FreeBSD ==== | + | ==== Debian/Ubuntu ==== |
+ | <code> | ||
+ | gate:~# squid -k check | ||
+ | |||
+ | gate:~# squid -k reconfigure | ||
+ | |||
+ | gate:~# tail -f /var/log/squid/access.log | ||
+ | </code> | ||
+ | |||
+ | ===== Использование для кеширования ===== | ||
+ | |||
+ | * !!! Не работает с https | ||
<code> | <code> | ||
- | [gate:~] # cat /etc/rc.conf | ||
- | </code><code> | ||
... | ... | ||
- | squid_enable=yes | + | maximum_object_size 1 GB |
+ | |||
+ | cache_dir ufs /var/spool/squid 5000 16 256 | ||
... | ... | ||
</code><code> | </code><code> | ||
- | [gate:~] # squid -k parse | + | # squid -z |
- | + | ||
- | [gate:~] # service squid start | + | |
- | + | ||
- | freebsd8# tail -f /var/squid/logs/access.log | + | |
- | + | ||
- | freebsd10# tail -f /var/log/squid/access.log | + | |
</code> | </code> | ||
- | ==== Debian/Ubuntu ==== | + | ===== Использование другого прокси ===== |
<code> | <code> | ||
- | root@gate:~# squid3 -k parse | + | ... |
+ | cache_peer proxy.isp.un parent 3128 0 default | ||
- | root@gate:~# service squid restart | + | never_direct allow all |
- | + | ... | |
- | root@gate:~# tail -f /var/log/squid/access.log | + | |
</code> | </code> | ||
- | |||