Strange error with ServerName and RSA SSL


I have generated new openssl certificate for my box to update the CN to the name of my hostname.

I have set this certificate like this :

openssl req -config /usr/share/openssl/openssl.cnf -new -out server.csr
openssl rsa -in privkey.pem -out server.key
openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
openssl x509 -in server.crt -out server.der.crt -outform DER

Then I have copied the server.crt and server.key in /etc/httpd/conf/ssl.crt and ssl.key

I have updated the ServerName in httpd.conf

But when I restart Apache I still have the error

[warn] RSA server certificate CommonName (CN) `’ does NOT match server name!?

I have checked and double checked

in /etc/httpd/conf/httpd.conf I have


And the cert use the same CN as shown below

openssl x509 -noout -text -in ssl.crt/server.crt

Version: 1 (0x0)
Serial Number: 0 (0x0)
Signature Algorithm: md5WithRSAEncryption
Issuer: C=FR, ST=Idf, L=Paris, O=Carat-Hosting, OU=technique,
Not Before: Dec 29 17:49:27 2006 GMT
Not After : Dec 29 17:49:27 2007 GMT
Subject: C=FR, ST=Idf, L=Paris, O=Carat-Hosting, OU=technique,

Any idea why I still have this error when starting up Apache ???

Thanks for your help



I have not set the ServerName in the good config file it’s normal it doesn’t work !!!

Of course you have to set the ServerName in /etc/httpd/conf.d/ssl.conf !!!