Author Topic: cwpsrv.service failed emerg  (Read 21200 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
cwpsrv.service failed emerg
« on: July 29, 2017, 12:27:13 AM »
● cwpsrv.service - CentOS Web Panel service (daemon)
   Loaded: loaded (/usr/lib/systemd/system/cwpsrv.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2017-07-28 20:25:39 EDT; 3s ago
  Process: 2289 ExecStartPre=/usr/local/cwpsrv/bin/cwpsrv -t (code=exited, status=1/FAILURE)

Jul 28 20:25:39  server systemd[1]: cwpsrv.service: control process exited, code=exited status=1
Jul 28 20:25:39  server systemd[1]: Failed to start CentOS Web Panel service (daemon).
Jul 28 20:25:39  server systemd[1]: Unit cwpsrv.service entered failed state.
Jul 28 20:25:39  server systemd[1]: cwpsrv.service failed.

-- Unit cwpsrv.service has begun starting up.
Jul 28 20:26:10  server cwpsrv[2322]: cwpsrv: [emerg] SL_CTX_use_PrivateKey_file("/etc/pki/tls/private/hostname.key")
Jul 28 20:26:10  server cwpsrv[2322]: cwpsrv:configuration file /usr/local/cwpsrv/conf/cwpsrv.conf test failed
Jul 28 20:26:10  server systemd[1]: cwpsrv.service: control process exited, code=exited status=1
Jul 28 20:26:10  server systemd[1]: Failed to start CentOS Web Panel service (daemon).
-- Subject: Unit cwpsrv.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit cwpsrv.service has failed.
--
-- The result is failed.


Offline
*
Re: cwpsrv.service failed emerg
« Reply #1 on: July 29, 2017, 08:07:53 AM »
hostname change should resolve certificate issue with the hostname
From cwp save your hostname again and it wil generate a new certificate and key

If that fails you can co it from the command line (use option from cwp first as that is recommended)
Code: [Select]
sh /scripts/generate_hostname_ssl
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
***
Re: cwpsrv.service failed emerg
« Reply #2 on: May 11, 2018, 10:10:03 AM »
hostname change should resolve certificate issue with the hostname
From cwp save your hostname again and it wil generate a new certificate and key

If that fails you can co it from the command line (use option from cwp first as that is recommended)
Code: [Select]
sh /scripts/generate_hostname_ssl

I had the same above issue and it worked perfectly. CWP is back again.  :)

Offline
*
Re: cwpsrv.service failed emerg
« Reply #3 on: July 16, 2018, 02:41:28 PM »
Worked for me as well. My symbolic link didn't work, so i just had to add the full path:

Code: [Select]
sh /usr/local/cwpsrv/htdocs/resources/scripts/generate_hostname_ssl
:)

Offline
*
Re: cwpsrv.service failed emerg
« Reply #4 on: July 23, 2018, 04:27:02 PM »
Worked for me as well. My symbolic link didn't work, so i just had to add the full path:

Code: [Select]
sh /usr/local/cwpsrv/htdocs/resources/scripts/generate_hostname_ssl

This solution didnt work for a long time, now I have again the same problem... :/

Offline
*
Re: cwpsrv.service failed emerg
« Reply #5 on: July 23, 2018, 05:07:38 PM »
Worked for me as well. My symbolic link didn't work, so i just had to add the full path:

Code: [Select]
sh /usr/local/cwpsrv/htdocs/resources/scripts/generate_hostname_ssl

This solution didnt work for a long time, now I have again the same problem... :/

OK, I traced the issue and it was caused by Let's Encrypt. It changed the mechanism of testing the certificates. After i ran the generate_hostname_ssl script, the CWP Admin Panel was working, but all my webpages, that were running Let's Encrypt SSL module had problem with their certificates - i couldn't access them. The httpd daemon was down telling me, it has problem with SSL (the same as the swpsrv before). I had to manually reinstall certificates for all websites, but after a while, the problem with hostname certificate showed up again - I couldn't access CWP Admin Module again. It seemd like infinite loop. I could only choose, if I want to access CWP Admin Panel or webpages.

What really solved my problem was to tell CWP not to use the hostname (.crt, .key) certificate, so the process swpsrv could start normally.

I edited all files in this folder:

/usr/local/cwpsrv/conf

and i had to comment out everything with ssl, so, in my case:

Code: [Select]
        ssl                 on;
        ssl_session_timeout 90m;
        ssl_certificate     /etc/pki/tls/certs/hostname.crt;
        ssl_certificate_key /etc/pki/tls/private/hostname.key;
        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers         HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;

to

Code: [Select]
#        ssl                 on;
#        ssl_session_timeout 90m;
#        ssl_certificate     /etc/pki/tls/certs/hostname.crt;
#        ssl_certificate_key /etc/pki/tls/private/hostname.key;
#        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
#        ssl_ciphers         HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers   on;

Now, my CWP works like a charm and I can also use the Let's Encrypt Certificates for webpages as usual. I am not able to use CWP Admin Panel with SSL, but I dont care 'cause I use VPN for accessing the CWP Admin Panel.

The problem ocures, when I create a new user, then the configuration file with enabled SSL is created, so the CWP Admin panel is down again. To make it work, i have to edit the new user configuration file and comment out the SSL so it can work again. Thank God, i don't create new users that often.

I am not sure about how proper this solution is, but it works for me great.
« Last Edit: July 23, 2018, 05:11:00 PM by TomVanLie »