If problems arise in the operation of your site (database errors, inaccessibility, errors 500, 502, 504), it is advisable to carry out diagnostics according to these instructions. This will shorten the time it takes for the support team to resolve the problem. Or you can eliminate the cause of the error yourself.
1. IS YOUR SERVER AVAILABLE FROM THE EXTERNAL NETWORK?
The easiest way to check if the server is available is to ping on your personal computer:
Windows OS:
Start - All Programs - Standard - Command line - Type ping ip.address of your server
Linux OS:
Launch Terminal - type: ping ip.address of your server
If your server is available, the output of the command will display the packet transmission and transmission speed. If the transfer of packets is not performed, the server is not available.
To check the server's network settings, connect to the server via SSH and run the command:
ifconfig
If in the output line inet addr blank - the problem is related to the network settings. Try to customize static IP address.
2. CHECK THE SERVICES
To check the services for the sites to work, connect to the server via SSH and use the commands:
Apache2 |
service apache2 status or service httpd status |
Nginx |
service nginx status
|
MySQL |
service mysql status service mysqld status |
MariaDB |
service mariadb status |
If the output does not contain the word running, the specified service is not running.
To start the services use the following commands:
Apache2 |
service apache2 start or service httpd start |
Nginx |
service nginx start |
MySQL |
service mysql start service mysqld start |
MariaDB |
service mariadb start |
Check site functionality after restarting services. If the problems persist, go to the next step.
3. STATE OF DISK SPACE
For general information about the disk space of your VPS server, connect to it via SSH and enter the command:
df -h
The command output will display the disk size and free space.
If there is not enough free disk space, you need to delete unnecessary files or expand disk.
For more detailed information about the state of the disk subsystem, you can use the utilities ncdu, du.
4. STATE INODES
If there is free space on the disk, but applications still report a lack of free space - most likely, inodes are full. For example, MySQL may throw Error 28 No space left on device. In this article you can read the instructions for diagnosing and fixing the overflow problem inodes.
5. RIGHTS FOR DIRECTORIES WITH LOGS
Check if write permissions have been assigned to the directories where the main services logs are written.
Service |
Directory |
MySQL |
/var/log/mysql/ |
Nginx |
/var/log/nginx/ |
Apache2 |
/var/log/apache2/ or /var/log/httpd/ |
To check the rights, enter the command:
ls -l/var/log/
The directories must have the correct permissions. The owner must have write, read and execute (rwx) rights.
Use the chmod command to set the required permissions. For example:
chmod -R 755/ var / log / mysql /
Here rights are set to 755, i.e. rwxr-xr-x... This is a complete set of rights for the owner. For the rest - read and execute rights.
To create a missing directory with logs, use the mkdir command. After creation, the permissions are set with the chmod command.
For example, to create a directory with logs for the Nginx service and set the appropriate rights, enter:
mkdir /var/log/nginx/
chmod -R 775/var/log/nginx/
After diagnostics, restart the services and test your site.
If the problems persist and the site does not work correctly – create ticket to technical support.