Score:0

Apache will not start

br flag

As title:

Added a ssl certificate and key into apaches folders ssl and ssl/private (etc/apache2/ssl)

Running apache -config test results in an error saying the key file is in the private folder is missing or empty running as sudo the OK is outputted no error..

Run to start the apache service I get the error exit code 1 please see error logs to that effect

On apache error log shows the ssl key and certificate error ( these certificates are from my domain supplier) basically cut and paste he contents of those into ssl/ssl.crt and ssl/private/key.key

Pointed the config to them correctly. Running as sudo I get an OK on the apache test config command

Come to start apache service no reason in journal-xe for failure just exit code 1

Repeated the command a few times at 10 min intervals to see logs nothing added extra at the time stamps I checked in the logs.

Any other points on where to look? Thanks

Edited to post logs

Jan 14 14:32:19 thanatos systemd[1]: Starting The Apache HTTP Server...
Jan 14 14:32:19 thanatos apachectl[2118]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to supp>
Jan 14 14:32:19 thanatos apachectl[2095]: Action 'start' failed.
Jan 14 14:32:19 thanatos apachectl[2095]: The Apache error log may have more information.
Jan 14 14:32:19 thanatos systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jan 14 14:32:19 thanatos systemd[1]: apache2.service: Failed with result 'exit-code'.
Jan 14 14:32:19 thanatos systemd[1]: Failed to start The Apache HTTP Server.

Apache error log:

[Thu Jan 13 14:37:56.373695 2022] [ssl:emerg] [pid 739] AH02565: Certificate and private key thanatos.wh-computers.co.uk:443:0 from /etc/ssl/private/sslcert.crt and /etc/ssl/private/sslkey.key do not match
AH00016: Configuration Failed
in flag
I'm not seeing *specific* errors from Apache in your question. Could you [edit] your post to include what Apache is telling you? Copy/paste is best. The `/var/log/apache2/error.log` file would have the most accurate information about *why* it's not starting ... unless you're using XAMPP ...
br flag
Edit Post to reflect changes, thanks for taking time to reply
in flag
You may want to confirm the copy/paste. If you used Windows for the task, there’s probable some garbage Unicode hidden in the file that’s messing up the validation
br flag
Thanks for formatting the post correctly, I will confirm the copy/paste and report back
us flag
https://serverfault.com/questions/1076853/how-to-fix-ah02565-certificate-and-private-key-do-not-match
br flag
@garethTheRed, thanks for replying I checked them earlier and they match 100% no windows garbage at all copied over
us flag
Did you compare modulus as one of the answers suggested?
br flag
Thanks for all thats commented, @garethTheRed modulus was checked and didnt(!) match on the 2nd attempt of getting a key and certs from the domain supplier. I revoked certificate and waited 48 hours and restarted the process and it now works Thanks
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.