RU
EUR
Бесплатная редакцияБесплатно Установить

Linux (Debian, Ubuntu)

The commands for Debian and Ubuntu: prepare the system, run the one-line installer, open the ufw firewall, check the services, upgrade and uninstall.

All ways to install

Какую версию вы устанавливаете

Публичная версия — версия для разработки с именем 0.3.0-dev. Её имя не меняется: каждая публикация заменяет предыдущую, а два выпуска различает идентификатор сборки. Стабильной версии пока нет: её опубликуют, только когда каждая система и каждый пакет пройдут сквозное тестирование. Поэтому команды на этой странице устанавливают продукт из канала dev. Версия для разработки может содержать ошибки: прежде чем на неё полагаться, попробуйте её на тестовом сайте.

At a glance

  • Debian 11 and later, Ubuntu 20.04 and later, amd64 and arm64. systemd 239 or newer and glibc 2.28 or newer are needed.
  • The installer adds missing prerequisites (curl, tar, libcap), creates an unprivileged user and installs the hardened systemd services toutwaf-dp (ports 80 and 443) and toutwaf-cp (console, port 9443).
  • If ufw is active it opens 80 and 443 and the console port 9443 (restrict it to your admin network with --console-from). Port 9444 is never opened automatically.
  • SELinux is not used by default on Debian and Ubuntu and no AppArmor profile is shipped: the systemd sandbox is the confinement.

The commands, step by step

Установите зависимости (apt)

bash
sudo apt update && sudo apt -y upgrade
sudo apt -y install curl tar ca-certificates ufw

Установка однострочным скриптом

Скрипт загружает нативные бинарные файлы для вашей архитектуры, создаёт отдельного непривилегированного пользователя и устанавливает защищённые службы systemd toutwaf-dp (плоскость данных, порты 80 и 443) и toutwaf-cp (плоскость управления и консоль, порт 9443), после чего выводит данные для первого входа.

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash

Хотите сначала прочитать скрипт?

Скачайте его, изучите и только потом запускайте. Рекомендуется для рабочих серверов.

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh -o install.sh
less install.sh
sudo bash install.sh

Параметры установщика

Новая установка размещается в одном каталоге, /var/toutwaf (bin, conf, data и logs; меняется параметром --home DIR или переменной TOUTWAF_HOME), а утилиты командной строки связываются в /usr/local/bin. Ранее выполненная установка сохраняет свои пути (/etc/toutwaf, /var/lib/toutwaf) и никогда не переносится.

options
# only let your admin network reach the console (port 9443)
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --console-from 203.0.113.0/24

# do not touch the host firewall / choose the installation home
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --no-firewall
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --home /opt/toutwaf

# name the channel explicitly (the installer of the dev branch already takes the dev channel; no stable version exists yet)
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --channel dev

Откройте межсетевой экран (ufw)

Установщик по умолчанию открывает эти порты, если активен firewalld или ufw: 80 и 443, а также порт консоли 9443 (ограничьте его сетью администраторов параметром --console-from). Порт агентов 9444 никогда не открывается для всех. Эти команды нужны только с --no-firewall, при другом брандмауэре или для ручной настройки.

ufw
sudo ufw allow 80,443/tcp
sudo ufw allow from 203.0.113.0/24 to any port 9443 proto tcp
sudo ufw --force enable
sudo ufw status

Управление службами

Обе службы запускаются при загрузке. Эти команды запускают, останавливают или перезапускают их.

systemd
sudo systemctl enable --now toutwaf-cp toutwaf-dp
sudo systemctl restart toutwaf-cp toutwaf-dp
sudo systemctl stop toutwaf-dp toutwaf-cp

Проверьте службы

bash
sudo systemctl status toutwaf-cp toutwaf-dp --no-pager
toutwafctl doctor
curl -kI https://127.0.0.1:9443/
curl -s http://127.0.0.1:9101/healthz
sudo journalctl -u toutwaf-dp -u toutwaf-cp -n 50 --no-pager

Обновление

Сделайте резервную копию настроек и данных и снова запустите установщик: он сохраняет ваши настройки и сам откатывается, если новая версия не стала работоспособной. Показаны пути новой установки (/var/toutwaf); более старая установка сохраняет /etc/toutwaf и /var/lib/toutwaf. Обновить можно и из консоли, на странице «Обновления».

bash
sudo mkdir -p /var/toutwaf.bak
sudo cp -a /var/toutwaf/conf /var/toutwaf/data /var/toutwaf.bak/
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --update --yes
curl -s http://127.0.0.1:9101/healthz

Удаление

Первый блок удаляет службы, бинарные файлы и правила брандмауэра, добавленные ToutWAF, и сохраняет ваши данные. Второй дополнительно удаляет настройки, данные и журналы.

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh -o install.sh
sudo bash install.sh --uninstall
purge
sudo bash install.sh --uninstall --purge

What is not verified

We prefer to say it plainly.

  • “Tested” means the full installation passed in a container with systemd on that version; it has not been tried on a clean real machine.
  • No stable version exists yet: the public version is the development version 0.3.0-dev.

Other ways to install

Learn more in the documentation