Когда кто-то пытается создать новый сертификат с помощью certbot, предполагается, что либо 80
или 443
должны быть доступны, но это не похоже на:
-------------------------------------------------------------------------------
The program nginx (process ID 123454) is already listening on TCP port 443. This
will prevent us from binding to that port. Please stop the nginx program
temporarily and then try again.
-------------------------------------------------------------------------------
At least one of the (possibly) required ports is already taken.
происходит.
Как продлить сертификаты без остановки сервисов, например nginx?
Попытка решить проблему
Версия?
root@hostname:~# letsencrypt --version
letsencrypt 0.4.1
Параметры?
root@hostname:~# letsencrypt --help
letsencrypt [SUBCOMMAND] [options] [-d domain] [-d domain] ...
The Let's Encrypt agent can obtain and install HTTPS/TLS/SSL certificates. By
default, it will attempt to use a webserver both for obtaining and installing
the cert. Major SUBCOMMANDS are:
(default) run Obtain & install a cert in your current webserver
certonly Obtain cert, but do not install it (aka "auth")
install Install a previously obtained cert in a server
renew Renew previously obtained certs that are near expiry
revoke Revoke a previously obtained certificate
rollback Rollback server configuration changes made during install
config_changes Show changes made to server config during installation
plugins Display information about installed plugins
Choice of server plugins for obtaining and installing cert:
(the apache plugin is not installed)
--standalone Run a standalone webserver for authentication
(nginx support is experimental, buggy, and not installed by default)
--webroot Place files in a server's webroot folder for authentication
OR use different plugins to obtain (authenticate) the cert and then install it:
--authenticator standalone --installer apache
More detailed help:
-h, --help [topic] print this message, or detailed help on a topic;
the available topics are:
all, automation, paths, security, testing, or any of the subcommands or
plugins (certonly, install, nginx, apache, standalone, webroot, etc)
Будет ли безопасно использовать следующий вариант?
(nginx support is experimental, buggy, and not installed by default) --webroot Place files in a server's webroot folder for authentication
Если вы пытаетесь использовать certbot в автономном режиме (отдельно от любого другого веб-сервера), то да, ваш веб-сервер необходимо остановить, чтобы certbot мог использовать эти порты.
Однако вы можете интегрировать каталоги, которые нужны certbot, прямо в конфигурацию вашего веб-сервера, и тогда самому certbot не нужно будет связываться с этими портами.
Я никогда не делал этого с nginx
, но вы могли бы certbot
использовать dns-01
Протокол ACME вариант. При этом зонды контроля домена, необходимые для обновления сертификата, происходят без привязки к портам, которые фактически обслуживают трафик.
Для этого вам, конечно же, необходимо иметь контроль над своим DNS и, вероятно, придется сигнализировать nginx
чтобы перезагрузить его конфигурацию после успешного обновления сертификата, но это можно сделать без простоя.