Bobcares

Vestacp 502 bad gateway – How we fix

by | Feb 3, 2021

Stuck with Vestacp 502 bad gateway? We can help you.

Vestacp 502 bad gateway issue occurs mainly due to lack of disk space or vesta session problems.

VestaCP is an open-source web control panel that is considered to be a great alternative to cPanel.

At Bobcares, we often receive requests from our customers to solve Vestacp errors as part of our Server Management Services.

Today, let’s see how our  Support Engineers fix this gateway error for our customers.

 

Methods to fix Vestacp 502 bad gateway

Some of the common causes for Vestacp 502 bad gateway includes disk space issue, vesta session problem or even PHP-fpm service issues. Let’s see how our Support Techs fix this for our customers.

 

1. Lack of Disk Space

One of the most common reasons for this error is the disk space issue.

When disk space reaches the limit the Vestacp returns 502 gateway error.

To fix this we will check the disk space usage and availability using the below command:

df -hCopy Code

If we notice the storage to be full, we can delete some unnecessary files and folders to increase the available space.

This is one way to fix this gateway error.

 

2. Vesta Session problem

We will delete the current vesta session folder to fix this.

The steps to follow are:

1. SSH to the server.

2. Then delete /usr/local/vesta/data/sessions folder using the following command:

rm -R /usr/local/vesta/data/sessionsCopy Code

3. Next we will create a new session folder using the following command:

mkdir  /usr/local/vesta/data/sessionsCopy Code

4. After that, we will set the permission to 775 for the folder using the following command:

chmod -R 775 /usr/local/vesta/data/sessionsCopy Code

5. And we will change the owner of the folder to admin: admin with the following command:

chown -R admin: admin /usr/ local/vesta/data/sessionsCopy Code

6. After that, we check the file  /usr/local/vesta/php/etc/php-fpm.confand make sure the file path.

php_admin_value [session.save_path] = /usr/local/vesta/data/sessionsCopy Code

7. Now we will edit the file /usr/local/vesta/php/etc/php-fpm.conf  by adding the following lnes:

vi /usr/local/vesta/php/etc/php-fpm.conf​Copy Code
php_admin_value [memory_limit] = 256M
php_admin_value [post_max_size] = 512M
php_admin_value [upload_max_filesize] = 512M
php_admin_value [max_execution_time] = 600
php_admin_value [max_input_time] = 600
php_admin_value [session.save_path] = /usr/local/vesta/data/sessionsCopy Code

8. Finally, we will restart the vesta service.

vesta service restartCopy Code

 

3. Restarting the PHP-fpm service.

At times, the PHP-fpm service causes this 502 gateway time out error. So we will try restarting the service using the following command:

service php-fpm restartCopy Code

[Still, stuck with this error?- We’ll help you.]

 

Conclusion

To conclude, we saw some of the common causes for Vestacp 502 bad gateway and the steps our Support Engineers follow to fix this.

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Speed issues driving customers away?
We’ve got your back!