Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to restart Apache on Google Cloud VM

Hi all,

Sorry in advance if I've posted this in the wrong place.

We have previously been using Bitnami Launchpad to run a basic Moodle server for our organisation. This has now migrated to Google Cloud's Compute Engine as Launchpad has been deprecated. It's been working well up until today.

We have previously written instructions on renewing our SSL certificate for the Moodle server, and have followed these through with no errors. However, when restarting Apache (the last step), HTTPD fails to come back up, and so Apache fails to start. As a result viewing our Moodle site via HTTP or HTTPS (or directly via IP) fails with a Connection Refused.

Full disclosure, I know very little about Apache and have been muddling through as best I can, but I can't figure out why Apache won't launch again and am not sure where to look. I'd really appreciate it if someone out there could give me a hand.

Solved Solved
0 4 933
1 ACCEPTED SOLUTION

Hey Damian,

My apologies - as I'm still learning what I'm doing with Apache it's taken me a while to get access to the logs and figure out what's going on.

It looks like the issue in this case was down to the SSL replacement, as I suspected it might be. Looking at the error_log, I found the most recent entries below:

[Wed May 17 10:49:21.837842 2023] [ssl:emerg] [pid 3379:tid 140684733551296] AH01895: Unable to configure verify locations for client authentication
[Wed May 17 10:49:21.837913 2023] [ssl:emerg] [pid 3379:tid 140684733551296] SSL Library Error: error:0906D066:PEM routines:PEM_read_bio:bad end line
[Wed May 17 10:49:21.837929 2023] [ssl:emerg] [pid 3379:tid 140684733551296] SSL Library Error: error:0B084009:x509 certificate routines:X509_load_cert_crl_file:PEM lib
[Wed May 17 10:49:21.837934 2023] [ssl:emerg] [pid 3379:tid 140684733551296] AH02312: Fatal error initialising mod_ssl, exiting.

The line in bold was the key one. Our previous instructions have us using the cat command to merge the Intermediate and Root certificates once uploaded to the server. It looks like this can occasionally cause the two to be merged with -----END CERTIFICATE----- and -----BEGIN CERTIFICATE----- on the same line - that's exactly what happened here. I downloaded the merged certificate, readded the space and uploaded the certificate again.

Once it was back in place I was able to restart Apache without any issue and the server is now working again. I'll be amending the instructions to make sure this doesn't happen again.

Thanks again for your help!

View solution in original post

4 REPLIES 4

Hello,

any logs ? Will be easier to troubleshoot if we will see logs with errors. 

cheers,
DamianS

Hi,
I'm guessing that you tried systemctl restart httpd command. Please paste the output from this command as well as from journalctl -xe command.  Would be also good to check logs somewhere there /var/log/something_with_httpd


One useful linkhttps://www.digitalocean.com/community/tutorials/how-to-troubleshoot-common-apache-errors

 

cheers,
DamianS

Hey Damian,

My apologies - as I'm still learning what I'm doing with Apache it's taken me a while to get access to the logs and figure out what's going on.

It looks like the issue in this case was down to the SSL replacement, as I suspected it might be. Looking at the error_log, I found the most recent entries below:

[Wed May 17 10:49:21.837842 2023] [ssl:emerg] [pid 3379:tid 140684733551296] AH01895: Unable to configure verify locations for client authentication
[Wed May 17 10:49:21.837913 2023] [ssl:emerg] [pid 3379:tid 140684733551296] SSL Library Error: error:0906D066:PEM routines:PEM_read_bio:bad end line
[Wed May 17 10:49:21.837929 2023] [ssl:emerg] [pid 3379:tid 140684733551296] SSL Library Error: error:0B084009:x509 certificate routines:X509_load_cert_crl_file:PEM lib
[Wed May 17 10:49:21.837934 2023] [ssl:emerg] [pid 3379:tid 140684733551296] AH02312: Fatal error initialising mod_ssl, exiting.

The line in bold was the key one. Our previous instructions have us using the cat command to merge the Intermediate and Root certificates once uploaded to the server. It looks like this can occasionally cause the two to be merged with -----END CERTIFICATE----- and -----BEGIN CERTIFICATE----- on the same line - that's exactly what happened here. I downloaded the merged certificate, readded the space and uploaded the certificate again.

Once it was back in place I was able to restart Apache without any issue and the server is now working again. I'll be amending the instructions to make sure this doesn't happen again.

Thanks again for your help!

Hi,
Good to hear, that problem is solved 🙂 and no need to apologize, as we all are learning constantly all the time. Mark topic as solved, if I could you ask for it. 

cheers,
DamianS