Anda menyebutkan bahwa Anda menggunakan Apache, namun jika Anda tidak terikat padanya ada jalan yang sangat mudah menggunakan Caddyserver .
Di sana Anda hanya perlu mendefinisikan Caddyfile
dengan konten berikut:
example.com
tls {
dns cloudflare
}
Sebutkan penyedia DNS yang Anda gunakan dalam konfigurasi dan konfigurasikan kunci API Anda melalui variabel lingkungan. Gambarlah dari daftar penyedia yang didukung dari dokumen .
Hanya itu yang dibutuhkan. Output pada awal pertama akan seperti:
Activating privacy features... 2019/10/21 13:36:48 [INFO][cache:0xc0001c8190] Started certificate maintenance routine
[INFO][cache:0xc000092730] Started certificate maintenance routine
2019/10/21 13:24:49 [INFO][example.com] Obtain certificate
2019/10/21 13:24:49 [INFO] [example.com] acme: Obtaining bundled SAN certificate
2019/10/21 13:24:50 [INFO] [example.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/876706285
2019/10/21 13:24:50 [INFO] [example.com] acme: Could not find solver for: tls-alpn-01
2019/10/21 13:24:50 [INFO] [example.com] acme: Could not find solver for: http-01
2019/10/21 13:24:50 [INFO] [example.com] acme: use dns-01 solver
2019/10/21 13:24:50 [INFO] [example.com] acme: Preparing to solve DNS-01
2019/10/21 13:24:50 [INFO] cloudflare: new record for example.com, ID XXX
2019/10/21 13:24:50 [INFO] [example.com] acme: Trying to solve DNS-01
2019/10/21 13:24:50 [INFO] [example.com] acme: Checking DNS record propagation using [127.0.0.11:53]
2019/10/21 13:24:50 [INFO] Wait for propagation [timeout: 2m0s, interval: 2s]
2019/10/21 13:24:50 [INFO] [example.com] acme: Waiting for DNS record propagation.
2019/10/21 13:24:52 [INFO] [example.com] acme: Waiting for DNS record propagation.
2019/10/21 13:24:55 [INFO] [example.com] The server validated our request
2019/10/21 13:24:55 [INFO] [example.com] acme: Cleaning DNS-01 challenge
2019/10/21 13:24:55 [INFO] [example.com] acme: Validations succeeded; requesting certificates
2019/10/21 13:24:56 [INFO] [example.com] Server responded with a certificate.
done.
Serving HTTPS on port 443
https://example.com
2019/10/21 13:36:48 [INFO] Serving https://example.com
Serving HTTP on port 80
http://example.com
2019/10/21 13:36:48 [INFO] Serving http://example.com