This article will show you how to find error logs within your Virtual Private Server.
If you’re experiencing issues with your websites, such as long loading times or blank pages, you may wish to check your error logs so that can diagnose these issues more efficiently. Simply click the relevant title below and follow the provided instructions to get started:
Via Apache
If you’re using cPanel, you can find your error log in the following directory:
/usr/local/apache/logs/error_log
You may also wish to check your domain access log if you think you’ve been the victim of a DDoS attack. This can be found in the following directory:
/usr/local/apache/domlogs/
You may also wish to check your HTTP or HTTPS log to see information relating to your website’s visitors, such as their IP address, browser info and the time they accessed your site:
HTTP log: /usr/local/apache/domlogs/$DOMAIN
HTTPS log: /usr/local/apache/domlogs/$DOMAIN-ssl_log
You can access and view these logs by using tools like vim and grep within SSH.
If you’re using Plesk, you can find your error log in the following directory:
/var/log/httpd/error_log
You may also wish to check your domain access log if you think you’ve been the victim of a DDoS attack. This can be found in the following directory:
/var/www/vhosts/domain_com/logs
You may also wish to check your HTTP or HTTPS log to see information relating to your website’s visitors, such as their IP address, browser info and the time they accessed your site:
HTTP log: /var/www/vhosts/$DOMAIN/logs/access_log
HTTPS log: /var/www/vhosts/$DOMAIN/access_ssl_log
You can access and view these logs by using tools like vim and grep within SSH.
Via PHP
If you’re using cPanel, you can find your error log in the following directory:
/home/cpanel_username/logs/$DOMAIN.php.error.log
You may also wish to check your PHP-FPM log to see any errors relating to this service. This can include slow loading times or one or more of your pages experiencing errors:
/opt/cpanel/ea-phpXX/root/usr/var/log/php-fpm/error.log
Please note: be sure to change phpXX to use your version of PHP-FPM (i.e. if you use PHP-FPM 7.1, you would enter php71).
You can access and view these logs by using tools like vim and grep within SSH.
If you’re using Plesk, you can find your error log in the following directory:
/var/www/vhosts/$DOMAIN/logs/$DOMAIN.php.error.log
You may also wish to check your PHP-FPM log to see any errors relating to this service. If you’re using CentOS, you can find this log within the following directory:
/var/www/vhosts/$DOMAIN/error_log
If you’re using Ubuntu, you can find this log within the following directory:
/var/www/vhosts/$DOMAIN/logs/php-fpm_error.log
You can access and view these logs by using tools like vim and grep within SSH.
Via MySQL
If you’re using MySQL 5.5, 5.6 and MariaDB 10.2, you can find your error log in the following directory:
/var/lib/mysql/$HOSTNAME.err
If you’re using MySQL 5.7 and later OR MariaDB 10.3 and later, you can find your error log in the following directory:
/var/log/mysqld.log
Via NGINX
You can find your error log in the following directory:
/var/log/nginx/error.log
You can access and view these logs by using tools like vim and grep within SSH.