Https бесплатно

Первоначальный запуск

./certbot-auto certonly --webroot -w /var/www/<my>/htdocs -d <sub.domain.com> --email <your email> --agree-tos

Удаление сертификата для домена

./certbot-auto delete

и выбрать домен из списка

Обновление сертификатов

Делается регулярно, т.к. срок действия — 90 дней.
Или внести в крон:

./path/to/certbot-auto renew --quiet 

или руками:

./path/to/certbot-auto renew# --dry-run

https://letsencrypt.org/how-it-works/

https://certbot.eff.org/#centosrhel6-nginx

Если при тестировании обновления с помощью команды ./path/to/certbot-auto renew --dry-run возникает следующая ошибка

.../.local/share/letsencrypt/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
You are using pip version 8.0.3, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

или

Command "python setup.py egg_info" failed with error code -9 in /tmp/pip-build-qRqJ36/zope.interface/

Certbot has problem setting up the virtual environment.

We were not be able to guess the right solution from your pip output.

То возникают они из-за недостатка памяти (у меня это возникло на digital ocean).
Сначала проверяем, что у нас не включен своп:

swapon -s

Решение:

sudo su
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

После этого запустить снова.
http://askubuntu.com/questions/159783/how-do-i-find-out-if-i-have-a-swap-partition-on-my-hard-drive
https://github.com/certbot/certbot/issues/1883#issuecomment-167662601

На CentOS создать swap чуть сложнее:

sudo dd if=/dev/zero of=/swapfile count=4096 bs=1MiB
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo nano /etc/fstab

add this line:

/swapfile   swap    swap    sw  0   0

run this command

sudo sysctl vm.swappiness=10

sudo nano /etc/sysctl.conf

add this line

vm.swappiness = 10
vm.vfs_cache_pressure = 50

To verify swap’s size

swapon --summary
free -h

https://unix.stackexchange.com/a/463776/362327

LEAVE A COMMENT