This helped.
I used SSH. For AWS you can use putty and the key pair along with the URL shown in the SSH client instructions under “Connect to instance” on AWS.
Some help with putty Connect to your Linux instance from Windows with PuTTY - Amazon Elastic Compute Cloud
Then you need to get into the docker container for openEMR.
“sudo docker ps” should show running containers. Get the ID for the openemr container here.
“sudo docker exec -it [container ID] sh” got me into the docker container command line. You should see “/var/www/localhost/htdocs/openemr #”.
certbot makes it easy and it’s already installed.
“certbot cert-only” starts the process. The added “-standalone” you might see online at the end of the command didn’t work for me. you will get the option of choosing 1 or 2. 2 worked. 1 is the same as using “standalone” I think. Didn’t work because port 80 was being used by the server. “Could not bind TCP port 80 because it is already in use by another process on this system (such as a web server). Please stop the program in question and then try again.” - was the error.
After getting past that I had this error : “The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.”
because I had disabled HTTP in AWS for the instance.
AFter getting past that the certificates were created and saved in:
/etc/letsencrypt/live/[domain name]/fullchain.pem
/etc/letsencrypt/live/[domain name]/privkey.pem
I felt that copying the files as suggested might lead to hassles when its time to renew so I chose to edit openemr.conf instead.
typed
“cd /etc/apache2/conf.d”
then
“vi openemr.conf”
Then changed the paths at the end of the file to this:
"SSLCertificateFile /etc/letsencrypt/live/ [domain name]/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ [domain name]/privkey.pem
"
press “ESC” type “:x” press “ENTER” to save and exit the editor.
restarted the instance and it was working.
Think that’s everything.