What to do if the site is inaccessible

What to do if the site is inaccessible

07:13, 17.11.2022

Article Content
arrow

  • Reasons for a site shutdown
  • What to do if the site is down
  • Clear disk space
  • Check the availability of services
  • Analyze the error code
  • Look at the logs
  • Activate error and debug output
  • Check the compatibility of PHP versions
  • Use Strace
  • Conclusion

The site is unavailable – it is a rare but unpleasant error, which can occur for a number of reasons. Below we will consider how to diagnose and correct the situation with the help of handy tools, software, and utilities.

Reasons for a site shutdown

There can be several of them:

  • Unauthorized domain name. If the NS server holder incorrectly configures the domain settings, this may cause an error. It may also be caused by technical work on the DNS side.
  • Problems at your provider. If there are problems with communication between parts of the network, some websites will be unavailable.
  • The domain registration period has expired. If this happens, you simply need to contact the organization where you registered the domain and extend the service.
  • The site is blocked in the country from which you are trying to open it. This is also not uncommon, especially for those resources that publish illegal or semi-legal content. You can use a VPN service to bypass the blocking.
  • Damaged cookies.

As a rule, errors of this kind are due to technical reasons, because of some internal failures on the server side. In most cases, this can be diagnosed and fixed.

What to do if the site is down

First of all, you have to do a few simple things:

  • Delete cookies. These files store website settings and profile data, and if for some reason they are corrupted, there is a good chance that the site will be unavailable to you. Simply go to your browser settings and delete your browsing data in the toolbar, then try accessing the site again.
  • Check if the URL in the address bar is correct. Maybe you just made a trivial typo or mistake.
  • If you use a VPN, try to change the country of connection to another country, and then try to access the site again.
  • Turn off your antivirus. If your antivirus detects a site as a threat, it can block access to it at a moment's notice. At the same time, be careful and turn off antivirus only if you are sure that the website is safe. Otherwise, there is a high risk of encountering virus software and other "surprises" of this kind.

Now let's move on to more complex manipulations for system administrators.

Clear disk space

If the storage space is full of logs, backups and other temporary files, you must connect to the server via SSH protocol and write two commands through the console:

df -i
df -h

This will show you how much space is free on the server SSD/HDD. If it shows something close to 100%, that is the reason why the site is not working. It just doesn't have enough space to run services and create new temporary files. In this situation, you can either clean up the existing space, or you can contact your hosting provider and expand your pricing plan.

Check the availability of services

Go to the control panel and check the status of services in the appropriate tab. In ISPmanager, for example, this menu is located on the left, in the "System" section. If any service fails - there will be a disabled "light" next to it. If any of these services is not working, you will have to deal with it separately.

Analyze the error code

When a site is inaccessible, in most cases the browser will give you some sort of three-digit error code when you try to open it. We have a separate article where we reviewed all the basic error codes that can occur when a client tries to contact the server. Once you understand the problem, it will be easier to localize and fix the error.

Look at the logs

It is necessary to check the key points:

  • whether there were any changes in the site's code;
  • Have there been any recent updates to the CMS and plugins – it may be that as a result of updates, plugins are in conflict with each other or with the content management system;
  • if the PHP version has not been changed;
  • whether you have backups and when they were made.

As a last resort, a previously created backup will allow you to roll back the changes to the state when the site was working properly.

what to do if the site is inaccessible

Activate error and debug output

Debugging information can be of great help in diagnosing and fixing bugs. For example, WordPress users can open the wp-config.php configuration file from the root directory in edit mode, and change the following directive in it:

define('WP_DEBUG', false);
define('WP_DEBUG', true);

As a result, the displayed information will become detailed and allow you to more accurately understand why the site is unavailable. Debug can be activated on any CMS:

  • Joomla – configuration.php;
  • OpenCart – Environment.php etc.

Check the compatibility of PHP versions

If the site and the server use different versions of PHP, this can cause a conflict, and the resource simply refuses to load. In this case, the error description will directly inform about it. For example, this:

Extension ‘mysql’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead

This error means that the user is trying to run the site on PHP version 7.0, while it is adapted to an earlier version of PHP. In this case, you need to update the version of PHP on the site and on the server so that they coincide.

Use Strace

This is an advanced utility that allows you to diagnose and debug almost any error that occurs on servers running Linux. Connect to the server via SSH and then install strace:

sudo apt update
sudo apt install strace

These commands are Ubuntu commands, but for other operating systems it should not be difficult to adapt the command.

The syntax for strace is as follows:

strace -s999 -o /tmp/strace.txt /opt/php71/php index.php

Here we have:

  • strace -s999 – call strace command with detailed output and write it to /tmp/strace.txt file;
  • /opt/php71/php – address of the PHP interpreter;
  • index.php – path to the called file.

With this utility you can monitor any system calls, which are a translation mechanism that provide an interface between a process and the OS kernel. You can intercept any calls and read them, which, with some skill and knowledge, allows you to diagnose and correct any error.

Conclusion

We hope that our article will help you understand why the site is unavailable and what you can do in this situation. If you have any questions, contact our specialists through Livechat. Take care!

views 5m, 24s
views 2
Share

Was this article helpful to you?

VPS popular offers

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.