#Обновим репозиторий нашей системы:
apt-get update
apt-get dist-upgrade
Перезагружаемся с нового ядра:
shutdown -r now
Установим прокси-сервер Squid3:
apt-get install squid3 apache2-utils
Переходим в папку с программой:
сd /etc/squid
Делаем копию дефолтных настроек сервиса squid:
cp squid.conf squid.conf.default
Редактируем файл конфигурации пркси сервера Squid3 до такого вида:
nano /etc/squid/squid.conf
Приводим его к виду:
#port
http_port 3128
#dns
dns_nameservers 208.67.222.222 208.67.220.220
#avto
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5 startup=5 idle=1
auth_param basic realm Welcome to Free VPN Proxy Master
auth_param basic credentialsttl 2 hours
#acl
acl all src all
acl Users proxy_auth REQUIRED
# ip
acl KnownUsers src "/etc/squid/KnownUsers.acl"
#open port
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
#dostup po ip ili pass
http_access allow KnownUsers
http_access allow Users
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
icp_access deny all
#anon
forwarded_for off
header_access From deny all
header_access Server deny all
header_access User-Agent deny all
header_replace User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/2>
header_access Referer deny all
header_replace Referer unknown
header_access WWW-Authenticate deny all
header_access Link deny all
header_access X-Forwarded-For deny all
header_access Via deny all
header_access Cache-Control deny all
#ulr
##header_access Referer deny all
coredump_dir /var/spool/squid
#disk kesch
cache_mem 8 MB
cache_dir null /tmp
cache deny all
shutdown_lifetime 5 seconds
#log
access_log none all
cache_store_log none
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
refresh_pattern . 0 20% 4320
Cоздаем файл для авторизации пользователей по логину и паролю:
touch /etc/squid/passwd
Cоздаем файл для авторизации пользователей по ip адресу:
touch /etc/squid/KnownUsers.acl
Добавляем нового пользователя (user) для авторизации по логину и паролю:
htpasswd /etc/squid/passwd user
New password:
Re-type new password:
Adding password for user user
Для авторизации пользователя без использования логина и пароля добавьте его ip адрес в файл:
nano /etc/squid/KnownUsers.acl
Делаем перезапуск squid:
service squid restart
По желанию можно также установить Pi-Hole (Чтобы избавиться от рекламы):
apt install curl
curl -sSL https://install.pi-hole.net | bash
Делаем остановку squid:
sudo systemctl stop squid
Делаем запуск squid:
sudo systemctl start squid
Смотрим статус работы squid:
sudo systemctl status squid
ВСЕ ГОТОВО! Можете подключаться из любого браузера используя это прокси. Только не забудьте в настройках прокси подключения указать ip адрес прокси-сервера который вы настроили и порт (этот порт должен быть открыт!).