Converting Amazon Linux nginx to Apache
Converting EBS nginx platform to apache[edit]
Tutorial: Configure SSL/TLS on Amazon Linux 2 - AWS Documentation
The page above links to Tutorial: Install a LAMP Web Server on Amazon Linux 2 which describes installing an Apache web server on Amazon Linux 2.
As a part of those instructions, this diagnostic was provided to confirm the state of the httpd service:
$ systemctl status -l httpd.service
Which returned these lines:
May 30 04:12:27 ip-172-31-39-99.us-west-2.compute.internal httpd[16139]: AH00526: Syntax error on line 10 of /etc/httpd/conf.d/ssl.conf: May 30 04:12:27 ip-172-31-39-99.us-west-2.compute.internal httpd[16139]: SSLCertificateFile: file '/etc/letsencrypt/live/LETSENCRYPT_DOMAIN/fullchain.pem' does not exist or is empty
“LETSENCRYPT_DOMAIN” should be the actual name of the domain that was used to create the security certificate. See below, [#Accessing_EBS_environment_variables_from_the_command_line]
This page, Migrating your Elastic Beanstalk Linux application to Amazon Linux 2, contains information about the difference between Amazon Linux and Amazon Linux 2, and some of the properties of Amazon Linux 2 that impact SSL.
$ sudo systemctl stop nginx
Then try running Apache.
Ok, after stopping nginx and then starting apache, it’s possible to get a response making a https request to the server. However, now in the EBS console the server’s status is listed as “degraded”.
Next question: how to put all of this into .ebextensions config files.
Also: make sure that the Let’s Encrypt certificate renews automatically.