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.
This is a quick and dirty list of the stages to install and set up memcache on centos 7 running php 5.4**
When the version of mysql on Centos 7 is actually the open-source mariadb branch, trying to restart the service with systemctl restart mysqld will fail. Here is how to restart maria:
systemctl restart mariadb
Sometimes, when migrating servers or copying data to a development environment for example, one needs to take a copy of an entire mysql database. Here is how you do this via the command line on a redhat/centos server:
- Generate a new certificate signing request (.csr) and key file (.key)
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
where server is the name of your server
- Fill in the details but you can leave email, challenge password and optional company name blank. Please note: The following characters cannot be accepted: < > ~ ! @ # $ % ^ / \ ( ) ?.,&
- Chek the contents of the csr: https://www.sslshopper.com/csr-decoder.html or enter this in the SSH console:
openssl req -in server.csr -noout -text
(again where server.csr is the name of the newly genererated csr file)
- Submit csr to commercial ssl provider.
- Copy the new certificate information into the correct location for the host. You may need to look at the virtual host settings or apache config file to see where an existing one is. * See below
- Do the same for the intermediate certificate file if there is one.
- Move (or copy) the key
- Change the apache (or virtual host) config file to point at the new certificates.
- Restart the webserver. For Debian this is “service apache2 restart”. For Centos this would be “service httpd restart” or “systemctl restart httpd” for newer Centos versions.
- Make sure the server restarts – any typos in the config will stop it from running – you will be notified.
Country Codes: https://www.digicert.com/ssl-certificate-country-codes.htm
Check they are working correctly: https://www.sslshopper.com/ssl-checker.html
A quicky this, for personal reference more than anything else.
Checking the Hostname
From within the console, run hostname to check the current hostname.
Changing the Hostname
To change the hostname run
check it has happened with hostname and then restart the network
systemctl restart network
(or simply network restart on older centos versions)
Here is a collection of useful and common mysql commands for managing database users using the command line, perhaps whilst logged in to the server via ssh. The following commands work for MySql and mariaDb. Don’t forget to include the semi-colon at the ends of each command. Continue reading mySQL (mariaDb) Useful User Management Via Command Line
Query caching can really help boost Magento’s performance where common queries are being called often, especially with Magento’s sprawling data structure. Continue reading Enable MYSQL Query Caching
So, you have a service running on server startup that you need to stop running. Here is how I stop a service from running on startup on Centos (Red Hat) using chkconfig. Continue reading Centos: remove service from running at server startup
Ok, so your webserver has crashed. You reboot it and…and…nothing. No website. Your apache / httpd and mysqld services have not restarted along with the server. Here is how to check if they should and make them do so if they aren’t.