Solved: Unable to configure RSA server private key

Better Stack Team
Updated on May 4, 2022


Unable to configure RSA server private key log message when running Apache.

Cause of the problem

This problem may occur if the private key and certificate do not match.


Compare the modulus of the certificate against the modulus of the private key to see if they match.

View the certificate modulus using the following command:

openssl x509 -noout -text -in certfile -modulus

Then, view the key using the following command:

openssl rsa -noout -text -in keyfile -modulus

Verify the following

  1. Verify that the certificate and private key file are saved in the file and that it has no trailing spaces.
  2. The modulus and public exponent portions in the key and the certificate must match exactly. (Make sure you aren't using the default server.key file)
  3. Check the httpd.conf file to make sure that the directives are pointing to the correct private key and certificate.

If they don't match, reissue the certificate.

Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

We are hiring.

Software is our way of making the world a tiny bit better. We build tools for the makers of tomorrow.

Explore all positions →

Reliability is the
ultimate feature

Delightful observability tools that turn your logs & monitoring into a secret weapon for shipping better software faster.

Explore Better Stack