Apache 2.4.9 fails after enabling ssl module and setting up ssl certificate

前端 未结 6 1118
悲哀的现实
悲哀的现实 2021-02-07 21:39

Apache throws the following errors after attempting to set up ssl certificates:

[ssl:emerg] [pid 30907] AH02572: Failed to configure at least one certificate and         


        
相关标签:
6条回答
  • 2021-02-07 21:55

    I ran into the same problem. Now I resolved it.

    You included

    /private/etc/apache2/extra/httpd-ssl.conf 
    

    in httpd.conf.

    So you still need to set following keys in 'httpd-ssl.conf'

    SSLCertificateFile "path to your crt"
    SSLCertificateKeyFile "path to your key"
    

    Hope it is helpful.

    0 讨论(0)
  • 2021-02-07 22:02

    I had these same errors after updating to Apache 2.4.33. It seems that SSLCertificateFile and SSLCertificateKeyFile now have to be inside the <VirtualHost> block, whereas previously they didn't.

    0 讨论(0)
  • 2021-02-07 22:04

    In hope to help new visitors.

    I had the same error lines in log file.

    My mistake was to include

    SSLEngine on
    

    outside a VirtualHost block, in a .conf file, along with common values for SSLProtocol, SSLCipherSuite, SSLHonorCipherOrder...

    0 讨论(0)
  • 2021-02-07 22:05

    I encountered this just today after upgrading to MacOS High Sierra version 10.13.6. My virtual hosts with SSL were working fine before the upgrade. Then today, when I tried to start up my Apache web server, I got this error:

    [Fri Jul 20 10:51:06.021778 2018] [ssl:emerg] [pid 2236] AH02572: Failed to configure at least one certificate and key for work.localweb.com:80
    [Fri Jul 20 10:51:06.022024 2018] [ssl:emerg] [pid 2236] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned
    [Fri Jul 20 10:51:06.022037 2018] [ssl:emerg] [pid 2236] AH02312: Fatal error initialising mod_ssl, exiting.
    AH00016: Configuration Failed
    

    Check my apache version and it is now 2.4.33. Apparently in this version you will need to put the SSLCertificateFile and SSLCertificateKeyFile entries in the virtual host itself. So, I copied the entries from extra/httpd-ssl.conf and put it in every SSL virtual host that I had configured.

    <VirtualHost *:443>
      ServerAdmin me@mymail.com
      ServerName work.localweb.com
      SSLCertificateFile "/private/etc/apache2/server.crt"
      SSLCertificateKeyFile "/private/etc/apache2/server.key"
      ......
    </VirtualHost>
    

    Then the start up works again.

    0 讨论(0)
  • 2021-02-07 22:07

    I also had the same problem. In my case I had also just included extra/httpd-ssl.conf as some of the others had mentioned. As said above, make sure you have entries in this file for

    SSLCertificateFile "/usr/local/etc/apache24/ssl.crt/mydomaincertificate.crt"

    SSLCertificateKeyFile "/usr/local/etc/apache24/ssl.key/myprivatekey.key"

    Even though the same entries are in extra/httpd-vhosts.conf for my main domain. I also had to make sure that in httpd.conf the "ServerName" entry matched a name in the certificate.

    While this is off no use to the OP, it may be of use to someone like me searching on this error after setting up SSL

    0 讨论(0)
  • 2021-02-07 22:13

    I ran into this problem after updating to Apache 2.4.33.

    I had to <VirtualHost></VirtualHost> blocks in my httpd-vhosts.conf file. I removed this one:

    <VirtualHost *:443>
        ServerName "<your server name>"
        DocumentRoot "<your path>"
    </VirtualHost>
    

    restarted apache and it worked.

    0 讨论(0)
提交回复
热议问题