Auto start Apache and MySQL on starting an AWS EC2 Linux instance
When an AWS EC2 instance is started/restarted, you can auto start Apache and MySQL services using the commands below.
Amazon Linux 1:
MySQL -
sudo chkconfig mysqld on
Apache -
sudo chkconfig httpd on
Amazon Linux 2:
MySQL -
sudo systemctl enable mysqld
Apache -
sudo systemctl enable httpd