Your server had to restart, either by design or after some bad event, and now your website doesn’t work – “connection failure”. Looks like your important web services are not set to start automatically on boot up. Here is what to do to get your httpd and mysqld services running on restart.
You need to add the httpd (apache web server) and mysqld (mysql database) services to the chkconfig and then set them to autostart.
As a super user (su), or by using sudo, do the following:
- /sbin/chkconfig –add httpd
- /sbin/chkconfig httpd on
- /sbin/chkconfig –list httpd
- /sbin/chkconfig –add mysqld
- /sbin/chkconfig mysqld on
- /sbin/chkconfig –list mysqld
If for some reason you want to stop them from autostarting you can do this:
/sbin/chkconfig httpd off
/sbin/chkconfig mysqld off
- systemctl enable httpd
- systemctl enable mysqld
Note: if your server is running mariadb you may need to use mariadb.service instead of mysqld
You can check the status of the service:
systemctl status httpd
systemctl status mysqld
systemctl status mariadb
Give your a server a reboot and, all being well, marvel at how everything just works straight away.