2

Cannot start apache2 server. error info is below.

Looking into similar questions (SSL Error - unable to read server certificate from file, Apache cannot read certificate file, and so on), still stuck in this problem. Any help is welcome. Thanks.

   me@localhost:/etc/apache2$ sudo service apache2 start
     * Starting web server apache2                                                                                    Action 'start' failed.
    The Apache error log may have more information.
                                                                                                               [fail]
    me@localhost:/etc/apache2$ sudo apachectl configtest
    Syntax OK

error.log:

[Thu Dec 17 17:24:11 2015] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Thu Dec 17 17:24:11 2015] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
[Thu Dec 17 17:25:27 2015] [error] Init: Unable to read server certificate from file /opt/conf/apache-portal-config/etc/ssl/server.crt

When running openssl x509 -noout -text -in to verify the cert file, everything is OK.

UPDATE

Running openssl rsa -in server.key -out server.out.key, Output is:

unable to load Private Key
140374406153888:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: ANY PRIVATE KEY
BAE
  • 121
  • 8
  • Did you vi the file to check if there is ^M at end of lines ? did you checked that the content begin with -----BEGIN CERTIFICATE----- ? – Froggiz Dec 17 '15 at 18:15
  • yes, I tries the solutions in the posted similar questions. – BAE Dec 17 '15 at 18:16
  • Can you try `openssl rsa -in ssl.key -out ssl.out.key` – Froggiz Dec 17 '15 at 18:20
  • @Froggiz, Should key start with -----BEGIN RSA PRIVATE KEY-----??? – BAE Dec 17 '15 at 18:27
  • Yes and some more, like encrypting type, if you don't have them, recreate the key will help you – Froggiz Dec 17 '15 at 18:29
  • @Froggiz, made stupid mistake. messed up the crt and key.... – BAE Dec 17 '15 at 18:32
  • You can download back crt from your SSL provider, and you should be able to recreate the key, and don't forget to back up them ! if you can t recreate the key, keep the one you get and try to add extra line at begin and end depending of you key type – Froggiz Dec 17 '15 at 18:35

0 Answers0