Amazon Ec2 - Apache Server Restart Issue

Restarting httpd on AWS EC2 behaves erratically. Is it supposed to delete the contents of /var/www/html?

I'm not sure what's happening with the deleting of the content, but you can try to use the graceful command to restart instead.

sudo apache2ctl graceful

This will gracefully reload its configuration!

or the reload command

sudo service httpd reload

How do you restart httpd to enable HTTPS on EC2 instance in Elastic Beanstalk?

The reason why your commands are failing is that on Amazon Linux 2
Python 3.7 environment there is no httpd (its physically installed, but not active). You can verify this by sshing into the instance and running:

sudo systemctl status httpd

Instead, there are nginx and gunicorn as wsgi. The link to the AWS docs you provided is for Amazon Linux 1, not 2.

Therefore, SSL certs and HTTPs should be setup using nginx config files in .platform/nginx/conf.d/ folder.



Related Topics



Leave a reply



Submit