Certbot-voorbeeld: geef en installeer een openbaar vertrouwenscertificaat voor Apache met behulp van HTTP-01-domeinvalidatie
Command syntax
Gebruik bij de opdrachtregelprompt de onderstaande opdrachtsyntaxis om een openbaar DV/OV/EV-certificaat uit te geven en te installeren voor de Apache-webserver, waarbij domeincontrolevalidatie wordt aangevraagd via HTTP-01:
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 |
---|---|
| The EAB key identifier (KID). For DigiCert® Trust Lifecycle Manager. accounts, use certificate profile. |
| The EAB HMAC key. |
| For hosted DigiCert® ONE accounts, use https://one.digicert.com/mpki/api/v1/acme/v2/directory |
| Local path to Certbot configuration files for the current application. These files control how and where Certbot installs certificates. If |
| The fully qualified domain name (FQDN) to secure the certificate. Use -d for each domain; the first entry becomes the common name (CN). |
Voorbeeld commando:
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
Het aangevraagde certificaatprofiel in DigiCert® Trust Lifecycle Manager moet gebaseerd zijn op de CertCentral Public Server-certificaat sjabloon. Zien Create an ACME-based profile for public CertCentral certificates.
De
--preferred-challenges
optie specificeert de voorkeursvorm van domeinvalidatie. Binnenkomenhttp
hier om HTTP-01-validatie aan te vragen.Deze opdracht wordt interactief uitgevoerd. Certbot presenteert u het onderstaande menu om te beslissen hoe de HTTP-validatie wordt uitgevoerd:
Selecteer optie 1 in het bovenstaande menu om Certbot de Apache-webserver automatisch te laten configureren voor HTTP-validatie. Uw webserver moet poort 80 open hebben. Certbot zal regels zoals de volgende toevoegen aan de virtuele hostconfiguratie voor poort 80:
Na validatie wordt de opdracht voltooid en wordt het certificaat uitgegeven en geïnstalleerd.
Als het aangevraagde certificaat overeenkomt met een bestaande bestelling, DigiCert® Trust Lifecycle Manager past de standaardautomatiseringsactie toe voor die bestelling (zie ACME-automatiseringsacties). Als er geen overeenkomende bestelling is, of als de ACME-URL dit bevat
?action=enroll
, Trust Lifecycle Manager behandelt het als een nieuwe bestelling en registreert het nieuwe certificaat voor u.