Cannot start httpd service after certificate change

Hi all!

I’ve changed a certificate and now cannot start the httpd service.

  1. Was the default certificate. I choose de NSRV certificate as default.
  2. I’ve delete de old certificate
  3. I get a new certificate with same DNS (autoconfig.domain.com, server.domain.com…), just a delete one of them (vpn.domain.com)
  4. I get those errors wen applying the new certificate as default

How can paste here the logs??

Error

dns.service_action_error

El siguiente comando ha fallado:
system-services/update

Desafortunadamente, no pudimos detectar el error exacto. Si desea ayudar, haga clic en el botón de abajo para copiar el comando fallido en el portapapeles, péguelo en la Terminal y envíe el resultado del comando a los desarrolladores.
echo '{"action":"start","name":"httpd"}' | /usr/bin/setsid /usr/bin/sudo /usr/libexec/nethserver/api/system-services/update | jq

{
“id”: “1649943546”,
“type”: “EventFailed”,
“message”: “Action failed”
}

@server ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

@server ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/httpd.service.d
           └─free_mutex.conf, quick_kill.conf
   Active: failed (Result: exit-code) since Thu 2022-04-14 15:39:34 CEST; 29s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 7651 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
  Process: 7645 ExecStartPre=/bin/bash -c ipcs -s | awk '$3=="apache" { print $2 }' | xargs -r -- ipcrm sem (code=exited, status=0/SUCCESS)
 Main PID: 7651 (code=exited, status=1/FAILURE)

Apr 14 15:39:34 server.pcxlan.es systemd[1]: Starting The Apache HTTP Server...
Apr 14 15:39:34 server.pcxlan.es httpd[7651]: [Thu Apr 14 15:39:34.265824 20...g
Apr 14 15:39:34 server.pcxlan.es httpd[7651]: AH00526: Syntax error on line ...:
Apr 14 15:39:34 server.pcxlan.es httpd[7651]: SSLCertificateFile: file '/etc...y
Apr 14 15:39:34 server.pcxlan.es systemd[1]: httpd.service: main process exi...E
Apr 14 15:39:34 server.pcxlan.es systemd[1]: Failed to start The Apache HTTP....
Apr 14 15:39:34 server.pcxlan.es systemd[1]: Unit httpd.service entered fail....
Apr 14 15:39:34 server.pcxlan.es systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

Thx 4 the help!!

Please, provide the output of

systemctl status httpd.service -l

or

apachectl configtest

It seems to report a syntax error on the sslcertificatefile

2 Likes

Ok, when selecting the certificate, it appears as default, but that command tells me that in the virtualhosts.conf file there is an error on line 47. Still appears server.* and not othersubdomain.*
"... SSLCertificateFile "/etc/letsencrypt/live/server.domain.com/cert.pem"

I have changed them to another certificate manually and I can start Apache at last
"... SSLCertificateFile "/etc/letsencrypt/live/othersubdomain.domain.com/cert.pem"

Now I can’t request a certificate again for those DNS

Thank you sooo much!

Goodnight everyone.

Well, in the end I managed to solve my blunder…

I have selected another certificate as default (although it does not make the change in virtualhosts.conf. I had to change it manually) and in shell, I have executed

service httpd-admin restart
service httpd restart

Afterwards, I have waited 30 seconds. I have logged back in and requested a new certificate with all the DNS I need. All perfect.
When I select that or any certificate as default through the cockpit, it does not give any error and the check box appears as default for the chosen certificate.

And if I look at /etc/httpd/conf.d/virtualhosts.conf it still appears as default the one I have changed manually.

Could it be a bug?