LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-04-2017, 06:47 AM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Rep: Reputation: 39
Apache server won't start when configured to use an issued certificate


Hello --

We are running Apache 2.2.10 on a Fedora 10 64-bit virtual box. The server currently uses a self-signed certificate and key combination for secure access to the website. I received a request to implement a certificate from a public authority as a replacement.

I went through the motions of generating a new key along with a csr that was submitted via email to the authority. A return email was sent listing the url where I could download the cer file. This file was downloaded directly to the server. The file in question is an X509 Based 64 Encoded file with four, 4, certificate sections. Affter that the file was renamed with the .crt extension, and copied in the ssl.crt directory. A similar action was done for the .key file in the ssl.key folder. The ssl.conf file was modified to reference the new files.

The /etc/init.d/httpd restart command was run, but the Apache server failed to start. The only way to get the server to start was to have it revert back to the private crt and key files.

I checked the log files: ssl_access, ssl_request, access, and error for entries that would indicate the problem, but there weren't any. The only thing that is apparent is the server will not run with the issued certificate.

Does anyone have an idea as to why this is occurring, and what steps need to be done to correct it? Thanks.
 
Old 02-04-2017, 07:23 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Could be a number of things. Bad CA, bad key type, etc. Can you separate out the cert to a file mycert and post the output of:

Code:
openssl x509 -in mycert -text
 
Old 02-04-2017, 07:50 AM   #3
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hello --

Thank-you for your reply. Per your instructions, the output of the file is the following:

Quote:
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1 (0x1)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=SE, O=AddTrust AB, OU=AddTrust External TTP Network, CN=AddTrust External CA Root
Validity
Not Before: May 30 10:48:38 2000 GMT
Not After : May 30 10:48:38 2020 GMT
Subject: C=SE, O=AddTrust AB, OU=AddTrust External TTP Network, CN=AddTrust External CA Root
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (2048 bit)
Modulus (2048 bit):
00:b7:f7:1a:33:e6:f2:00:04:2d:39:e0:4e:5b:ed:
1f:bc:6c:0f:cd:b5:fa:23:b6:ce:de:9b:11:33:97:
a4:29:4c:7d:93:9f:bd:4a:bc:93:ed:03:1a:e3:8f:
cf:e5:6d:50:5a:d6:97:29:94:5a:80:b0:49:7a:db:
2e:95:fd:b8:ca:bf:37:38:2d:1e:3e:91:41:ad:70:
56:c7:f0:4f:3f:e8:32:9e:74:ca:c8:90:54:e9:c6:
5f:0f:78:9d:9a:40:3c:0e:ac:61:aa:5e:14:8f:9e:
87:a1:6a:50:dc:d7:9a:4e:af:05:b3:a6:71:94:9c:
71:b3:50:60:0a:c7:13:9d:38:07:86:02:a8:e9:a8:
69:26:18:90:ab:4c:b0:4f:23:ab:3a:4f:84:d8:df:
ce:9f:e1:69:6f:bb:d7:42:d7:6b:44:e4:c7:ad:ee:
6d:41:5f:72:5a:71:08:37:b3:79:65:a4:59:a0:94:
37:f7:00:2f:0d:c2:92:72:da:d0:38:72:db:14:a8:
45:c4:5d:2a:7d:b7:b4:d6:c4:ee:ac:cd:13:44:b7:
c9:2b:dd:43:00:25:fa:61:b9:69:6a:58:23:11:b7:
a7:33:8f:56:75:59:f5:cd:29:d7:46:b7:0a:2b:65:
b6:d3:42:6f:15:b2:b8:7b:fb:ef:e9:5d:53:d5:34:
5a:27
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
AD:BD:98:7A:34:B4:26:F7:FA:C4:26:54:EF:03:BD:E0:24:CB:54:1A
X509v3 Key Usage:
Certificate Sign, CRL Sign
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Authority Key Identifier:
keyid:AD:BD:98:7A:34:B4:26:F7:FA:C4:26:54:EF:03:BD:E0:24:CB:54:1A
DirName:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
serial:01

Signature Algorithm: sha1WithRSAEncryption
b0:9b:e0:85:25:c2:d6:23:e2:0f:96:06:92:9d:41:98:9c:d9:
84:79:81:d9:1e:5b:14:07:23:36:65:8f:b0:d8:77:bb:ac:41:
6c:47:60:83:51:b0:f9:32:3d:e7:fc:f6:26:13:c7:80:16:a5:
bf:5a:fc:87:cf:78:79:89:21:9a:e2:4c:07:0a:86:35:bc:f2:
de:51:c4:d2:96:b7:dc:7e:4e:ee:70:fd:1c:39:eb:0c:02:51:
14:2d:8e:bd:16:e0:c1:df:46:75:e7:24:ad:ec:f4:42:b4:85:
93:70:10:67:ba:9d:06:35:4a:18:d3:2b:7a:cc:51:42:a1:7a:
63:d1:e6:bb:a1:c5:2b:c2:36:be:13:0d:e6:bd:63:7e:79:7b:
a7:09:0d:40:ab:6a:dd:8f:8a:c3:f6:f6:8c:1a:42:05:51:d4:
45:f5:9f:a7:62:21:68:15:20:43:3c:99:e7:7c:bd:24:d8:a9:
91:17:73:88:3f:56:1b:31:38:18:b4:71:0f:9a:cd:c8:0e:9e:
8e:2e:1b:e1:8c:98:83:cb:1f:31:f1:44:4c:c6:04:73:49:76:
60:0f:c7:f8:bd:17:80:6b:2e:e9:cc:4c:0e:5a:9a:79:0f:20:
0a:2e:d5:9e:63:26:1e:55:92:94:d8:82:17:5a:7b:d0:bc:c7:
8f:4e:86:04
-----BEGIN CERTIFICATE-----
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
MB4XDTAwMD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ShjTK3rMUUKhemPR5ruhxSvC
Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
-----END CERTIFICATE-----
 
Old 02-04-2017, 08:32 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
That's a CA certificate only says https://www.sslshopper.com/certificate-decoder.html
 
Old 02-04-2017, 08:59 AM   #5
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
X509v3 Key Usage:
Certificate Sign, CRL Sign

Means this is not your web cert.
 
Old 02-04-2017, 09:20 AM   #6
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
I had better list the steps that I had taken to determine what I, probably, did wrong:

1. I received an email indicating that enrollment was successful, and the SSL certificate had been issued for the host. The email listed several links to download the certificate in various formats. The formats listed were the following:

Quote:
X509, Base64 encoded
PKCS#7, Base64 encoded
PKCS#7 Bin Encoded
X509 Certificate only, Base64 encoded
X509 Intermediates/root only Base64 encoded
X509 Intermediates/root only Reverse, Base64 encoded
Each version of the certificate was saved in a different folder.

2. I copied the X509, Base64 encoded file to the appropriate folder, and changed the .cer suffix to the .crt ending. As mentioned previously, the .key file retained its suffix, and it was copied to its directory.

Did I copy the wrong version of the file, or should I have deployed the file and key differently?
 
Old 02-06-2017, 11:39 AM   #7
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
I think most likely your crt file contains multiple certs and you did not separate out the web cert before running openssl. Apache configuration expects the CA cert and web cert to be in different files.
 
Old 02-06-2017, 11:50 AM   #8
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hello --

Thank-you for your reply. The hyperlink listed has the procedure that I used to generate the csr and key files.

https://support.rackspace.com/how-to...-with-openssl/

I did a comparison of the public crt with that of the private crt, and while the private one had one 'paragraph' with a header and footer, the public one had four paragraphs.

If the procedure is wrong, then what steps should I have taken to complete this task?

Last edited by kaplan71; 02-06-2017 at 11:52 AM.
 
Old 02-10-2017, 01:25 PM   #9
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Where can I go from here?
 
Old 02-10-2017, 01:40 PM   #10
PastulioLive
Member
 
Registered: Nov 2014
Posts: 39

Rep: Reputation: Disabled
Quote:
Originally Posted by kaplan71 View Post
I had better list the steps that I had taken to determine what I, probably, did wrong:

1. I received an email indicating that enrollment was successful, and the SSL certificate had been issued for the host. The email listed several links to download the certificate in various formats. The formats listed were the following:



Each version of the certificate was saved in a different folder.

2. I copied the X509, Base64 encoded file to the appropriate folder, and changed the .cer suffix to the .crt ending. As mentioned previously, the .key file retained its suffix, and it was copied to its directory.

Did I copy the wrong version of the file, or should I have deployed the file and key differently?
I'm not an expert by any means, but can you try using the "X509 Certificate only, Base64 encoded" file instead?
Perhaps the first link has some CA chains along with the cerftificate.
 
Old 02-10-2017, 02:23 PM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Key > csr > x509 crt
Have a look through https://www.instantssl.com/ssl-certi...te-apache.html
for some common scenarios and possible solutions.
 
Old 02-25-2017, 06:08 AM   #12
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hello --

I contacted the technical support staff of the certificate issuer, and after talking with them, I made the following configuration changes:

1. I downloaded the ca-bundle file from their website, and renamed it to reflect the name of our server. This file, along with the .crt file was then copied to the /etc/httpd/ssl.crt folder. The key file that had been generated on the server was, in turn, copied to the /etc/httpd/ssl.key folder.

2. The following changes were made to the httpd.conf and ssl.conf files:

httpd.conf
Quote:
SSLEngine On
SSLCertificateKeyFile /etc/httpd/ssl.key/<server.name>.key
SSLCertfiicateFile /etc/httpd/ssl.crt/<server_name>.crt
SSLCertiicateChainFile /etc/httpd/ssl.crt/<server_name>.ca-bundle
ssl.conf
Quote:
SSLCertificateKeyFile /etc/httpd/ssl.key/<server.name>.key
SSLCertfiicateFile /etc/httpd/ssl.crt/<server_name>.crt
SSLCertiicateChainFile /etc/httpd/ssl.crt/<server_name>.ca-bundle
I attempted to restart the server, and it failed to do so. During the process of bringing the server back to its original state I noticed two things:

1. The server restarted when the httpd.conf file was left with the changes made, while the ssl.conf had to be brought back to its original configuration.
2. There is another set of ssl.crt and ssl.key folders located in the /etc/httpd/conf directory. The files at these locations were not modified during this procedure.
 
Old 02-25-2017, 07:11 AM   #13
PastulioLive
Member
 
Registered: Nov 2014
Posts: 39

Rep: Reputation: Disabled
Quote:
Originally Posted by kaplan71 View Post
Hello --

I contacted the technical support staff of the certificate issuer, and after talking with them, I made the following configuration changes:

1. I downloaded the ca-bundle file from their website, and renamed it to reflect the name of our server. This file, along with the .crt file was then copied to the /etc/httpd/ssl.crt folder. The key file that had been generated on the server was, in turn, copied to the /etc/httpd/ssl.key folder.

2. The following changes were made to the httpd.conf and ssl.conf files:

httpd.conf


ssl.conf


I attempted to restart the server, and it failed to do so. During the process of bringing the server back to its original state I noticed two things:

1. The server restarted when the httpd.conf file was left with the changes made, while the ssl.conf had to be brought back to its original configuration.
2. There is another set of ssl.crt and ssl.key folders located in the /etc/httpd/conf directory. The files at these locations were not modified during this procedure.
Hi Kaplan,

Good thing you are following up on this!

Did you manage to solve the problem and use the certicate sent by your CA?
If not, you should post the error message generated by the service httpd start command (or output of systemctl status httpd if the server is running systemd).

Most likely it was complaining that you had setup two SSL configurations and only one is allowed.
You should put your SSL configuration in ssl.conf, and not int httpd.conf (ssl.conf should be included automatically by httpd.conf)
 
Old 02-25-2017, 09:07 AM   #14
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
First it seems you have a typos in the lines above (for example "SSLCertfiicateFile" should be "SSLCertificateFile", etc...).

Second (as mentioned by PastulioLive) why do you define the key, cert and chain in both httpd.conf and ssl.conf. They should be defined only in one place (I suppose ssl.conf where, by the way, also "SSLEngine On" and all the other required SSL related configuration options should be located).

I don't think your problem is related to the certificate itself. Most probably you have a syntax error(s) in the SSL configuration of your Apache server.

You could check your configuration starting the server with the option "configtest".

Last edited by gda; 02-25-2017 at 09:08 AM.
 
Old 02-26-2017, 03:26 AM   #15
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 421

Rep: Reputation: 74
Try:

Code:
httpd -S
ls -l  /etc/httpd/ssl.key/<issued-cert>.key
could be lax permission on the key.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTPD won't start NSS_Initialize failed. Certificate database Winanjaya Linux - Server 1 08-02-2013 07:03 AM
Creating a formal SSL certificate for Fedora issued by Geocerts fedora.brett Linux - Newbie 1 12-08-2010 10:24 PM
X won't start - screen not configured properly dcroxton Ubuntu 15 08-08-2010 10:22 AM
CDP (CRL Distribution Point) problem in issued certificate while implementing PKI mohit gupta Linux - Newbie 1 05-21-2009 12:35 AM
chrooted apache server won't start tca23 Linux - Software 3 08-30-2004 08:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration