# Генерация Let's Encrypt SSL

<figure><img src="/files/LDgP7LaXbEXNX76a19aV" alt=""><figcaption></figcaption></figure>

Для начала обновляем списки пакетов и репозиториев системы:

```
sudo apt-get -y update && sudo apt-get -y dist-upgrade
```

Устанавливаем **CertBot**:

```
sudo apt-get -y install certbot
```

Далее производим установку дополнительных пакетов:

Для **Nginx**:

```
sudo apt-get -y install python3-certbot-nginx
```

Для **Apache2**:

```
sudo apt-get -y install python3-certbot-apache
```

## Генерация сертификата: <a href="#generaciya-sertifikata" id="generaciya-sertifikata"></a>

{% hint style="info" %}
Обратите внимание на то, что **веб-сервер** должен быть включен!
{% endhint %}

Для **Nginx**:

```
certbot certonly --nginx -d yoursite.com
```

Для **Apache2**:

```
certbot certonly --apache -d yoursite.com
```

Если у Вас нет возможности включить **Веб-сервер**, используйте следующую команду:

```
certbot certonly --standalone -d yoursite.com
```

Используем команду для автоматической выдачи **SSL-сертификата**:

```
certbot renew
```

{% hint style="info" %}
Далее ежедневно будет проходить автоматическая проверка на валидность Вашего сертификата.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.qwins.co/veb-razrabotka/generaciya-lets-encrypt-ssl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
