Changes between Initial Version and Version 1 of ApacheGetsslNeuesCert


Ignore:
Timestamp:
Aug 1, 2020, 4:57:39 PM (5 years ago)
Author:
Johannes Lode
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ApacheGetsslNeuesCert

    v1 v1  
     1= getssl einrichten
     2
     3**Achtung:** DNS-Einrichtung muss schon funktionieren, damit `getssl` funktioniert.
     4
     5 a. für einen Web-Host mit eigenem SSL-Cert:
     6   1. in das Verzeichnis `~root/.getssl` wechseln
     7   1. Host-/Domain-Verzeichnis anlegen: `mkdir twiki.mtronig.de`
     8   1. Konfigurationsdatei `twiki.mtronig.de/getssl.cfg` erstellen:
     9{{{
     10# Uncomment and modify any variables you need
     11# see https://github.com/srvrco/getssl/wiki/Config-variables for details
     12# see https://github.com/srvrco/getssl/wiki/Example-config-files for example configs
     13#
     14# The staging server is best for testing
     15#CA="https://acme-staging-v02.api.letsencrypt.org/directory"
     16# This server issues full certificates, however has rate limits
     17#CA="https://acme-v02.api.letsencrypt.org"
     18
     19#PRIVATE_KEY_ALG="rsa"
     20
     21# Additional domains - this could be multiple domains / subdomains in a comma separated list
     22# Note: this is Additional domains - so should not include the primary domain.
     23#SANS="trac.mtronig.de"
     24
     25# Acme Challenge Location. The first line for the domain, the following ones for each additional domain.
     26# If these start with ssh: then the next variable is assumed to be the hostname and the rest the location.
     27# An ssh key will be needed to provide you with access to the remote server.
     28# Optionally, you can specify a different userid for ssh/scp to use on the remote server before the @ sign.
     29# If left blank, the username on the local server will be used to authenticate against the remote server.
     30# If these start with ftp: then the next variables are ftpuserid:ftppassword:servername:ACL_location
     31# These should be of the form "/path/to/your/website/folder/.well-known/acme-challenge"
     32# where "/path/to/your/website/folder/" is the path, on your web server, to the web root for your domain.
     33#ACL=('/var/www/twiki.mtronig.de/web/.well-known/acme-challenge'
     34#     'ssh:server5:/var/www/usvn.vpn21.net/web/.well-known/acme-challenge'
     35#     'ssh:sshuserid@server5:/var/www/usvn.vpn21.net/web/.well-known/acme-challenge'
     36#     'ftp:ftpuserid:ftppassword:usvn.vpn21.net:/web/.well-known/acme-challenge')
     37
     38#Set USE_SINGLE_ACL="true" to use a single ACL for all checks
     39#USE_SINGLE_ACL="false"
     40
     41# Location for all your certs, these can either be on the server (full path name)
     42# or using ssh /sftp as for the ACL
     43DOMAIN_CERT_LOCATION="/var/www/twiki.mtronig.de/ssl/server.crt"
     44DOMAIN_KEY_LOCATION="/var/www/twiki.mtronig.de/ssl/server.key_decrypted"
     45CA_CERT_LOCATION="/var/www/twiki.mtronig.de/ssl/ca-bundle.pem"
     46#DOMAIN_CHAIN_LOCATION="" # this is the domain cert and CA cert
     47#DOMAIN_PEM_LOCATION="" # this is the domain_key, domain cert and CA cert
     48
     49# The command needed to reload apache / nginx or whatever you use
     50#RELOAD_CMD=""
     51
     52# Define the server type. This can be https, ftp, ftpi, imap, imaps, pop3, pop3s, smtp,
     53# smtps_deprecated, smtps, smtp_submission, xmpp, xmpps, ldaps or a port number which
     54# will be checked for certificate expiry and also will be checked after
     55# an update to confirm correct certificate is running (if CHECK_REMOTE) is set to true
     56#SERVER_TYPE="https"
     57#CHECK_REMOTE="true"
     58}}}
     59   1. `getssl` Konfiguration testen: `getssl twiki.mtronig.de`; \\ ggf. den Test forcieren: `getssl -f twiki.mtronig.de` \\
     60   Das Ergebnis soll so aussehen:
     61{{{
     62# getssl -f twiki.mtronig.de
     63
     64Registering account
     65Verify each domain
     66Verifying twiki.mtronig.de
     67twiki.mtronig.de is already validated
     68Verification completed, obtaining certificate.
     69Requesting Finalize Link
     70Requesting Order Link
     71Requesting certificate
     72Full certificate saved in /root/.getssl/twiki.mtronig.de/fullchain.crt
     73Certificate saved in /root/.getssl/twiki.mtronig.de/twiki.mtronig.de.crt
     74copying domain certificate to /var/www/twiki.mtronig.de/ssl/server.crt
     75copying private key to /var/www/twiki.mtronig.de/ssl/server.key_decrypted
     76copying CA certificate to /var/www/twiki.mtronig.de/ssl/ca-bundle.pem
     77reloading SSL services
     78 * Gracefully restarting apache2 ...                               [ ok ]
     79twiki.mtronig.de - certificate installed OK on server
     80certificate obtained for twiki.mtronig.de
     81# _
     82}}}
     83   1. "staging"-Konfiguration auf volle Konfiguration umstellen, indem die Zeile `CA="https://acme-staging-v02.api..."` deaktiviert wird (darf schon inaktiv sein, weil die globale Konfiguration für getssl diese CA vorgibt) und stattdessen die Zeile `CA="https://acme-v02.api.letsencrypt.org"` aktiviert wird.
     84   1. Produktiv-Zertifikat holen: \\ `getssl twiki.mtronig.de` \\ Das Ergebnis soll etwa so aussehen:
     85{{{
     86# getssl twiki.mtronig.de
     87Registering account
     88Verify each domain
     89Verifying twiki.mtronig.de
     90copying challenge token to /var/www/letsencrypt/Yfh65tFtentC8QnrHM3eSH3WFfOmmcVTNlJk3XGYaRk
     91sending request to ACME server saying we're ready for challenge
     92checking if challenge is complete
     93Pending
     94checking if challenge is complete
     95Verified twiki.mtronig.de
     96Verification completed, obtaining certificate.
     97Requesting Finalize Link
     98Requesting Order Link
     99Requesting certificate
     100Full certificate saved in /root/.getssl/twiki.mtronig.de/fullchain.crt
     101Certificate saved in /root/.getssl/twiki.mtronig.de/twiki.mtronig.de.crt
     102copying domain certificate to /var/www/twiki.mtronig.de/ssl/server.crt
     103copying private key to /var/www/twiki.mtronig.de/ssl/server.key_decrypted
     104copying CA certificate to /var/www/twiki.mtronig.de/ssl/ca-bundle.pem
     105reloading SSL services
     106 * Gracefully restarting apache2 ...                                [ ok ]
     107twiki.mtronig.de - certificate installed OK on server
     108certificate obtained for twiki.mtronig.de
     109# _
     110}}}
     111   1. //fertig - freu! //