[SOLVED] CWP 502 Bad Gateway Cwpsrv

If your VPS is running CentOS and you use Control Web Panel (CWP), you may get this error at one time or the other: 502 Bad Gateway cwpsrv

502 bad gateway cwpsrv
CWP 502 Bad Gateway Cwpsrv Error

For me, I got the error when I deleted a User through the CWP admin interface. When this error shows up, you cannot log into your CWP admin panel to carry out any tasks.

502 Bad Gateway Cwpsrv [SOLVED]

There are two ways you can solve the 502 Bad Gateway Cwpsrv error. In most cases, any 502 Bad Gateway error can be solved by running this command:

sh /scripts/restart_cwpsrv

If running the above command does not solve your problem, here’s the second option:

First off, you should check the phpfpm service to confirm that it is running. Type this command through SSH:

systemctl status cwp-phpfpm

If the service is not running and cannot start, you have to find the User that is producing the error. To do so, check this file /usr/local/cwp/php71/var/log/php-fpm.log

tail /usr/local/cwp/php71/var/log/php-fpm.log

You will see the name of User has an error (eg. stetho.conf).

Delete the file stetho.conf from /usr/local/cwp/php71/etc/php-fpm.d/users/stetho.conf   by running this command:

rm -f /usr/local/cwp/php71/etc/php-fpm.d/users/stetho.conf

After this, run the following command to start Phpfpm

systemctl start cwp-phpfpm

From here, the 502 Bad Gateway cwpsrv should have been solved.

Let me know in the comment section below whether you have any questions.

Written By
I Cozens
More from I Cozens

It’s Aight

Today has been a bad day. There wasn't any freelance writing work...
Read More

4 Comments

  • Hello Sir,

    I’m trying to login via ssh, but to no avail, even when i try to connect via telnet the connection is lost immediately…

    I’m the owner of the server, using Control Web Panel, via CentOS 7.6 server…

    The Control Web Panel admins are being extremely difficult, like talking to a brick wall to be honest.
    There was a required update to be performed, which I carried out as I normally would in the past with no issues, but this time the PHP-Switch update has appeared to bog down the server, now I can’t login, i keep getting 502 bad gateways…

    do you have any other tips i can follow?

    Thanks

    • Hi Loz,

      If you cannot log into SSH, you should check your VPS credentials (password and username). SSH login is not related to CWP interface, but your VPS. Log into your VPS provider’s portal and check or change the password from there, then try loggin in.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.