Всем привет. Сегодня будет про то, как на сервере интернет-провайдера на ALT Linux настроить:
- службу сетевого времени на базе сервиса chrony
- веб-сервер nginx как обратный прокси-сервер
- web-based аутентификацию
1. Настраиваем Chrony — службу точного времени:
Делаем сервер сервером:
control chrony serverИ затем настраиваем сервер:
sed -i 's/pool pool.ntp.org iburst/pool pool.ntp.org iburst prefer minstratum 4/' /etc/chrony.conf | grep pool /etc/chrony.conf
sed -i 's/\#local stratum 10/local stratum 5/' /etc/chrony.conf | grep "local stratum" /etc/chrony.conf
systemctl restart chronyd2. Настраиваем NGINX — обратный прокси-сервер:
Ставим nginx:
apt-get install nginx -yПишем конфиг:
cat << "EOF" > /etc/nginx/sites-available.d/r-proxy.conf
server {
listen 80;
server_name web.au-team.irpo;
location / {
proxy_pass http://172.16.1.10:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
server {
listen 80;
server_name docker.au-team.irpo;
location / {
proxy_pass http://172.16.3.10:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
EOFЗатем включаем nginx:
ln -s /etc/nginx/sites-available.d/r-proxy.conf /etc/nginx/sites-enabled.d/
nginx -t
systemctl enable --now nginx
systemctl status nginx3. Настраиваем базовую аутентификацию на прокси-сервере:
apt-get install apache2-htpasswd -y
htpasswd -c /etc/nginx/.htpasswd WEB
cat /etc/nginx/.htpasswd