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
How to Find Files Excluding Symbolic Links
How to Recursively Copy a Directory into Another and Replace Only the Files That Have Not Changed
Code Snippet Managers for Linux Desktops
Can't Su to User Jenkins After Installing Jenkins
Centos Through a Vm - No Urls in Mirrorlist
Nginx Not Listening to Port 80
Convert Bash 'Ls' Output to JSON Array
Sort a Tab Delimited File Based on Column Sort Command Bash
Why Is Dd with the 'Direct' (O_Direct) Flag So Dramatically Faster
The Return Code from 'Grep' Is Not as Expected on Linux
How to Tell What a Linux Process Is Waiting For
Dummy Questions About Setting Up Git on Amazon Cloud Ec2
Bash File Is Running Fine in Windows for Testng But It Is Not Working in Linux/Mac
How to List (Ls) the 5 Last Modified Files in a Directory
Convert All File Extensions to Lower-Case