I am trying to create the SSL certificate in AWS lightsail and forcing HTTP to HTTPS. I did the following things
(1) added DOMAIN and EMAIL in the docker-compose.yml
and run ./docker-compose up -d
.
(2) In docker log “container”, I saw certificate was issued in my domain Name
Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/health.dpanalytics.com/fullchain.pem
(3) changed openemr.conf to force from HTTP to HTTPS
<VirtualHost *:80>
ServerName health.dpanalytics.com
ServerAlias www.health.dpanalytics.com
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R,L]
</VirtualHost>
(4) changed ssl.conf
ServerName health.dpanalytics.com ServerAdmin myemail@domain.com
(5) restarted container , but could not load server
(6) checked the container log file
Starting cron daemon! Starting apache! Love OpenEMR? You can now support the project via the open collective: > https://opencollective.com/openemr/donate Starting cron daemon! Starting apache! httpd (pid 14) already running
(7) checked the apache error file and found it
health.dpanalytics.com:443:0 server certificate does NOT include an ID that matches the server name
When I commented out (3), the server will load with HTTP. Highly appreciated any help.