====== Procedure to Create and Update HTTPS Certificates for ericjulie.com ====== ===== Names We Register ===== (Copied from current certificate, July 16, 2022) * ad.ericjulie.com (active directory by Nethserver) * collabora.ericjulie.com (web version of office software in Nextcloud) * hydrogen.ericjulie.com (Swanson photo sharing website) * koha.ericjulie.com (library system) * mattermost.ericjulie.com (team communication system) * neon.ericjulie.com (Nethserver, Koha, Nextcloud, Mattermost, DokuWiki, mail, http/s, etc.) * photos.ericjulie.com (alternate for hydrogen.ericjulie.com) * www.ericjulie.com (neon.ericjulie.com alternate) ===== Notes ===== * The computer that you create the certificate on must be directly plugged into the internet router. * We create one certificate with many names and then copy the certificate to the other machines. ===== How to Create or Update a Certificate ===== * Log into Nethserver, go to System -> Certificates * Actions -> Let's Encrypt Certificate * Fill out the domains and submit it. * You can view it in Nethserver to make sure the dates have been updated. * Restart webserver and http-admin services, then logout to activate new certificate. ===== How to Transfer Certificate to Koha ===== * SSH into Nethserver from Mac ''ssh -p 2222 root@192.168.0.10'' and enter the password. * Change to the letsencrypt archive directory ''cd /etc/letsencrypt/archive'' * Copy the certificate files from neon to Koha's Root home directory ''rsync -va ./neon.ericjulie.com/* root@192.168.0.119:/root/neon.ericjulie.com/'' and enter root password for Koha. * Quit the SSH into Nethserver ''exit''. * SSH into Koha from Mac ''ssh root@192.168.0.119'' and enter the root password for Koha. * Change to the existing Koha certificate file location ''cd /etc/letsencrypt/archive'' * Copy the newly copied certificate to the letsencrypt/archive directory ''cp -r ~/neon.ericjulie.com ./'' * Change to the live certificate directory ''cd /etc/letsencrypt/live/neon.ericjulie.com'' (assuming it exists, if not just create that directory ''mkdir /etc/letsencrypt/live/neon.ericjulie.com'') * You can do a directory listing to see all the symbolic links that we will be updating in this process ''ls -al'' * Do a directory listing from the archive to see what the highest number is for the certificates, i.e. "cert23.pem" ''ls -al /etc/letsencrypt/archive/neon.ericjulie.com/'' * Delete the current cert.pem file ''rm cert.pem'' * Create a new symbolic link using the new file (the one with the highest number) ''ln -s /etc/letsencrypt/archive/neon.ericjulie.com/cert##.pem cert.pem'' (replace ## with the number) * Delete the chain.pem file ''rm chain.pem'' * Create a new symbolic link (as above) ''ln -s /etc/letsencrypt/archive/neon.ericjulie.com/chain##.pem chain.pem'' (replace ## with the number) * Delete the fullchain.pem file ''rm fullchain.pem'' * Create a new symbilic link (as above) ''ln -s /etc/letsencrypt/archive/neon.ericjulie.com/fullchain##.pem fullchain.pem'' * Delete the privkey.pem file ''rm privkey.pem'' * Create a new symbolic link (as above) ''ln -s /etc/letsencrypt/archive/neon.ericjulie.com/privkey##.pem privkey.pem'' (replace ## with the number) * Check which certificate is selected ''cat /etc/apache2/sites-available/koha-ssl.conf'' and look for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' * Restart Apache on Koha to activate the new certificate ''systemctl restart apache2'' * Restart Webmin on Koha otherwise it will show the old certificate ''systemctl restart webmin'' * To verify the dates of the current certificate on Koha (assuming you are still in the /etc/letsencrypt/live/neon.ericjulie.com directory) ''openssl x509 -startdate -enddate -noout -in cert.pem'' * Exit Koha's SSH ''exit'' ===== How to Transfer Certificate to Hydrogen Photo Sharing Site ===== * SSH into Nethserver from Mac ''ssh -p 2222 root@192.168.0.10'' and enter the password. * Change to the letsencrypt archive directory ''cd /etc/letsencrypt/archive'' * Copy the certificate files from neon to Hydrogen's Root home directory ''rsync -va ./neon.ericjulie.com/* root@192.168.0.1:/root/neon.ericjulie.com/'' and enter root password for Hydrogen. * Quit the SSH into Nethserver ''exit''. * SSH into Hydrogen from Mac ''ssh root@192.168.0.1'' and enter the root password for Hydrogen. * Change to the existing Hydrogen certificate file location ''cd /etc/letsencrypt/archive'' * Copy the newly copied certificate to the letsencrypt/archive directory ''cp -r ~/neon.ericjulie.com ./'' * Change to the live certificate directory ''cd /etc/letsencrypt/live/neon.ericjulie.com'' * You can do a directory listing to see all the symbolic links that we will be updating in this process ''ls -al'' * Do a directory listing from the archive to see what the highest number is for the certificates, i.e. "cert23.pem" ''ls -al /etc/letsencrypt/archive/neon.ericjulie.com/'' * Delete the current cert.pem file ''rm cert.pem'' * Create a new symbolic link using the new file (the one with the highest number) ''ln -s /etc/letsencrypt/archive/neon.ericjulie.com/cert##.pem cert.pem'' (replace ## with the number) * Delete the chain.pem file ''rm chain.pem'' * Create a new symbolic link (as above) ''ln -s /etc/letsencrypt/archive/neon.ericjulie.com/chain##.pem chain.pem'' (replace ## with the number) * Delete the fullchain.pem file ''rm fullchain.pem'' * Create a new symbilic link (as above) ''ln -s /etc/letsencrypt/archive/neon.ericjulie.com/fullchain##.pem fullchain.pem'' * Delete the privkey.pem file ''rm privkey.pem'' * Create a new symbolic link (as above) ''ln -s /etc/letsencrypt/archive/neon.ericjulie.com/privkey##.pem privkey.pem'' (replace ## with the number) * Check which certificate is selected ''cat /etc/apache2/sites-available/hydrogen.ericjulie.com-le-ssl.conf'' and look for ''SSLCertificateFile'' and ''SSLCertificateKeyFile'' * Restart Apache on Hydrogen to activate the new certificate ''systemctl restart apache2'' * Restart Webmin on Hydrogen otherwise it will show the old certificate ''systemctl restart webmin'' * To verify the dates of the current certificate on Hydrogen (assuming you are still in the /etc/letsencrypt/live/neon.ericjulie.com directory) ''openssl x509 -startdate -enddate -noout -in cert.pem'' * Exit Hydrogen's SSH ''exit''