× RO CSVI is a great tool that is used to update eshops and projects with a lot of data

CWP7 Panel Down After Update – 502 Bad Gateway and Missing hostname Certificate

Περισσότερα
11 Ώρες 15 Λεπτά πριν #352 από infogate
I recently experienced the same problem on several CWP7 servers running AlmaLinux 8 and AlmaLinux 9.The hosted websites continued working normally, but the CWP administrator panel on port 2031 became unavailable:
[url]https://server-hostname:2031/[/url]
The browser displayed a 502 Bad Gateway error. Initially, it looked like Apache or CWP PHP-FPM was down, but the actual cause was different.SymptomsThe CWP service would not start:
systemctl status cwpsrv --no-pager -l
It showed:
ExecStartPre=/usr/local/cwpsrv/bin/cwpsrv -t
status=1/FAILURE
Running the CWP configuration test revealed the real error:
/usr/local/cwpsrv/bin/cwpsrv -t
Error:
cannot load certificate "/etc/pki/tls/certs/hostname.crt":
BIO_new_file() failed
No such file or directoryconfiguration file /usr/local/cwpsrv/conf/cwpsrv.conf test failed
The CWP PHP-FPM service was still running, and Apache continued serving all websites. Therefore, this was specifically a cwpsrv certificate problem.What caused the outage?The following files were missing:
/etc/pki/tls/certs/hostname.crt
/etc/pki/tls/certs/hostname.bundle
However, the valid Let’s Encrypt certificate still existed inside the CWP ACME directory:
/root/.acme.sh/cwp_certs/your-server-hostname/
In my case, an automatic overnight update upgraded cwpsrv and restarted the service. The update did not necessarily delete the certificate. The certificate copy may have already been missing, while cwpsrv continued working because the certificate was loaded in memory.When the update restarted cwpsrv, it could no longer load the missing certificate file and refused to start.Important hostname warningDo not automatically trust:
hostname -f
On some VPS servers, especially older AlmaLinux 8 installations, this may return the hosting provider’s hostname, for example:
vps2578003.fastwebserver.de
The actual CWP hostname may be:
olympus.freespirits.gr
You must use the hostname for which the CWP panel certificate was issued.To see the available CWP certificates, run:
ls -lah /root/.acme.sh/cwp_certs/
Safe recovery procedureFirst, stop the continuous cwpsrv restart loop:
systemctl stop cwpsrv
Set the correct CWP hostname manually:
CWP_HOST="your-server-hostname.example.com"
ACME_DIR="/root/.acme.sh/cwp_certs/$CWP_HOST"
For example:
CWP_HOST="olympus.freespirits.gr"
ACME_DIR="/root/.acme.sh/cwp_certs/$CWP_HOST"
Confirm that the certificate files exist:
ls -lah "$ACME_DIR"
You should find:
your-server-hostname.example.com.cer
fullchain.cer
ca.cer
your-server-hostname.example.com.key
Verify the certificate and private key before installing anythingGenerate the certificate public-key hash:
openssl x509 -in "$ACME_DIR/$CWP_HOST.cer"
-pubkey -noout |
openssl pkey -pubin -outform DER |
sha256sum
Generate the installed private-key hash:
openssl pkey
-in /etc/pki/tls/private/hostname.key
-pubout -outform DER |
sha256sum
The two hashes must be identical.Example:
d57038207e6788661d6962d896bda76796de9ae74e14d45ad7d0434620d62faf
d57038207e6788661d6962d896bda76796de9ae74e14d45ad7d0434620d62faf
Do not continue if the hashes are different. A mismatched certificate and private key will not work.Restore the missing certificate filesIf the hashes match, run:
install -m 644
"$ACME_DIR/$CWP_HOST.cer"
/etc/pki/tls/certs/hostname.crt
Then restore the complete certificate chain:
install -m 644
"$ACME_DIR/fullchain.cer"
/etc/pki/tls/certs/hostname.bundle
Test the CWP configuration:
/usr/local/cwpsrv/bin/cwpsrv -t
You may still see a warning similar to:
the "ssl" directive is deprecated
This is only a warning. The important result is that the configuration test succeeds.Now restart CWP:
systemctl restart cwpsrv
systemctl status cwpsrv --no-pager -l
Finally, test the panel locally:
curl -kI --connect-timeout 10 [url]https://127.0.0.1:2031/[/url]
An HTTP 200, 301 or 302 response normally confirms that the CWP panel is responding again.You should now be able to access:
[url]https://your-server-hostname.example.com:2031/[/url]
Important safety notes
  1. Never copy a certificate from another server unless it explicitly covers the destination server’s hostname.
  2. Always compare the certificate and private-key hashes first.
  3. Do not replace
    /etc/pki/tls/private/hostname.key
    unless you are certain it is missing or incorrect.
  4. This problem is unrelated to Apache when hosted websites continue working.
  5. A running cwpsrv process can keep working even after its certificate file disappears because the certificate is already loaded in memory. The failure may only become visible after a restart or update.
  6. Avoid scripts that indiscriminately delete or truncate system logs. They may not delete the certificate directly, but they can destroy the evidence needed to identify what happened.
SummaryThe CWP panel failed because cwpsrv could not find:
/etc/pki/tls/certs/hostname.crt
The valid certificate was still available inside:
/root/.acme.sh/cwp_certs/CWP-HOSTNAME/
After verifying that the certificate matched the existing private key, restoring
hostname.crt
and
hostname.bundle
immediately brought the CWP panel back online.I hope this guide saves other CWP administrators time—especially if the problem appears suddenly after an automatic overnight cwpsrv update.

The best possible way to start your online marketing : fspirits.com/go/leadsleap-home
Create Amazing AI Videos : fspirits.com/go/video-express-ai
Start your affiliate journey here: fspirits.com/go/olsp-academy
Edit And Create Videos: fspirits.com/go/create-studio-pro
Best Solution To Create Graphics: fspirits.com/go/artistly
Smart Chat Automation: fspirits.com/go/chatterpal
Multi-Purpose Video Maker: fspirits.com/go/avatar-builder
Multi-Purpose Video Creator: fspirits.com/go/videocreator
AI Human Spokesperson Videos: fspirits.com/go/humanpal

Παρακαλούμε Σύνδεση ή Δημιουργία λογαριασμού για να συμμετάσχετε στη συζήτηση.

Χρόνος δημιουργίας σελίδας: 0.055 δευτερόλεπτα
Powered by Kunena Φόρουμ
Banner Image