Skip to main content

Certbot-Beispiel: Zertifikat für Apache mithilfe der HTTP-01-Domänenvalidierung ausstellen und installieren

Command syntax

Verwenden Sie an der Befehlszeilenaufforderung die folgende Befehlssyntax, um ein öffentliches DV/OV/EV-Zertifikat für den Apache-Webserver auszustellen und zu installieren und eine Domänenkontrollvalidierung über HTTP-01 anzufordern:

sudo certbot --apache --register-unsafely-without-email --eab-kid {MY-KEY-IDENTIFIER} --eab-hmac-key {MY-HMAC-KEY} --server {ACME-URL} --config-dir {MY-CONFIG-DIR} -d {FQDN} --manual --preferred-challenges http

Fill in values for the command arguments shown in curly braces, as described below:

Command argument

Description

{MY-KEY-IDENTIFIER}

The EAB key identifier (KID). For CertCentral. accounts, use ACME credentialsi.

{MY-HMAC-KEY}

The EAB HMAC key.

{ACME-URL}

For CertCentral accounts, use https://one.digicert.com/mpki/api/v1/acme/v2/directory

{MY-CONFIG-DIR}

Local path to Certbot configuration files for the current application. These files control how and where Certbot installs certificates. If --config-dir is omitted, Certbot defaults to /etc/letsencrypt.

{FQDN}

The fully qualified domain name (FQDN) to secure the certificate. Use -d for each domain; the first entry becomes the common name (CN).

Beispielbefehl:

sudo certbot --apache --register-unsafely-without-email --eab-kid abcdef8sCnHGBsbCOgnv1ijy00l6UeEYCavSSSirl-k --eab-hmac-key EEEraHBXQUxWTEFGdFhndjRVNmV4t4F6c2VNZDM1QzRURGhjdHF3S1NublJjN0dhVUFObzA0SXJwVHBnU2yyUH --server https://one.digicert.com/mpki/api/v1/acme/v2/directory --config-dir /usr/local/certbot/my_other_public_webserver_config/ -d test.com -d www.test.com --manual --preferred-challenges http

Usage notes

  • Bei OV/EV-Zertifikaten werden Domänenvalidierungsprüfungen nur dann vom ACME-Protokoll durchgeführt, wenn die Domäne nicht bereits in CertCentral vorab validiert wurde. Wenn die Domäne Ist Vorab validiert, dann validiert CertCentral die Domäne selbst, Out-of-Band und unabhängig vom ACME-Protokoll.

  • For DV certificates, and for OV/EV certificates that are not prevalidated, the --preferred-challenges option specifies the preferred form of ACME-based domain validation. Enter http here to request HTTP-01 validation.

  • Dieser Befehl wird interaktiv ausgeführt. Certbot präsentiert Ihnen das folgende Menü, in dem Sie entscheiden können, wie die HTTP-Validierung durchgeführt wird:

    How would you like to authenticate with the ACME CA?
    ---------------------------------------------------------------------------
    1. Apache Web Server plugin (apache)
    2. Obtain certificates using a DNS TXT record (if you are using AWS Route 53 for DNS). (dns-route53)
    3. Spin up a temporary webserver (standalone)
    4. Place files in webroot directory (webroot)
    ---------------------------------------------------------------------------
    Select the appropriate number [1-4] then [enter] (press 'c' to cancel):
  • Wählen Sie im obigen Menü Option 1 aus, damit Certbot den Apache-Webserver automatisch für die HTTP-Validierung konfiguriert. Auf Ihrem Webserver muss Port 80 geöffnet sein. Certbot fügt der virtuellen Hostkonfiguration für Port 80 Zeilen wie die folgenden hinzu:

    Alias /.well-known/acme-challenge/ "/var/www/acme/acme-challenge/"
    RewriteRule "^/.well-known/acme-challenge/" = [L]
    <Directory "/var/www/acme/acme-challenge/">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
    </Directory>
  • Nach der Validierung wird der Befehl abgeschlossen und das Zertifikat wird ausgestellt und installiert.

  • Wenn das angeforderte Zertifikat mit einer bestehenden Bestellung übereinstimmt, CertCentral wendet die Standardautomatisierungsaktion für diese Bestellung an (siehe ACME-Automatisierungsaktionen). Wenn es keine passende Bestellung gibt oder wenn die ACME-URL Folgendes enthält ?action=enroll, CertCentral behandelt es als neue Bestellung und registriert das neue Zertifikat für Sie.