3

I downloaded Apache 2.4 from Apache Lounge and installed it on Windows 7, as a development server, and it worked fine. Now I'm try to use SSL with a self-signed certificate but restarting the service fails with:

The Apache2.4 service terminated with service-specific error Incorrect function..

I remember that Apache 2.2 had a specific OpenSSL download if you wanted to use SSL. Is this the case with Apache 2.4?

What else could cause the problem?

I have made sure that:

  1. Ports 80 and 443 are free
  2. LoadModule ssl_module modules/mod_ssl.so is uncommented
  3. Include conf/extra/httpd-ssl.conf is also uncommented
3
  • check the apache error log if that provides more detail
    – HBruijn
    Jul 26, 2016 at 18:24
  • Apache logs provide nothing.
    – Warwick
    Jul 26, 2016 at 18:43
  • It's been a long, long time since I last used Apache on Windows, but start up errors might be logged in the Windows event log instead. But running a server on a desktop OS makes your question off-topic for ServerFault.
    – HBruijn
    Jul 26, 2016 at 18:58

3 Answers 3

4

I just had this same problem. By running httpd.exe itself, I was given the following output:

AH00526: Syntax error on line 92 of C:/Apache24/conf/extra/httpd-ssl.conf:
SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you
need to load the appropriate socache module (mod_socache_shmcb?).

The fix is to uncomment the following line in httpd.conf:

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
1
  • This IS the way.
    – dkellner
    May 27, 2022 at 9:30
1

Check your Apache error logs. I had this error, and my error message in there was:

AH02572: Failed to configure at least one certificate and key for www.example.com:443  

This was in my conf/extra/httpd-ssl.conf file, and I ended up commenting out the entire block for

#<VirtualHost _default_:443>
#    ....
#</VirtualHost>
0

Had the same problem, but I was using ApacheHaus. CTarczon advice of running httpd.exe was a helpful piece of advice, but my problem was not related to missing the socache module. I got an error indicating that I was opening the same port twice. Since this was an https problem, I knew it was port 443 (or the error told me it was port 443, can't quite remember). I searched the configuration files and found that the "Listen 443" directive appeared in two configuration files: httpd_ssl.conf and http_ahssl.conf. It turns out that I took the advice to uncomment out "Include conf/extra/httpd-ssl.conf". ApacheHaus substitutes that with the line "Include conf/extra/http_ahssl.conf". So that was an easy fix, just commented the http_ssl.conf include line. It's possible that ApacheLounge is doing a similar thing. When you're first working with this stuff, its not clear that they are mutually exclusive; one or the other, but not both. This did not appear as an error in the log, and running httpd.exe from the command line was the ticket to knowing what was going on.

I also had changed the server certificate rather then using the localhost server certificate that is used for testing. Here's the virtual host configuration section that was located in the http_ahssl.conf file.

<VirtualHost _default_:443>
  SSLEngine on
  ServerName localhost:443
  #SSLCertificateFile "${SRVROOT}/conf/ssl/server.crt"
  #SSLCertificateKeyFile "${SRVROOT}/conf/ssl/server.key"
  SSLCertificateFile "${SRVROOT}/conf/ssl/myhost.crt"myhost.key"
  SSLCertificateKeyFile "${SRVROOT}/conf/ssl/myhost.key"
  DocumentRoot "${SRVROOT}/htdocs"
# DocumentRoot access handled globally in httpd.conf
    CustomLog "${SRVROOT}/logs/ssl_request.log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    <Directory "${SRVROOT}/htdocs">
    Options Indexes Includes FollowSymLinks
    AllowOverride AuthConfig Limit FileInfo
    Require all granted
    </Directory>
</virtualhost>

The first time I ran it, I got that same error "Incorrect function". But this time I got a meaningful error message in the log:

Init: SSLPassPhraseDialog builtin is not supported on Win32 (key file C:/Apache/httpd/Apache24/conf/ssl/myhost.key)
Fatal error initialising mod_ssl, exiting.

That one was easily fixed and the fix is well documented at: https://www.ssl247.com/kb/ssl-certificates/troubleshooting/apache/tn-5634-error-sslpassphrasedialog-not-supported-win32

I'll also add my 2 cents about the log not showing you anything meaningful. First verify that your configuration has the logging module enable. It sounds like you did, because you said that didn't get anything meaningful. The second thing is make sure that your Virtual Host configuration has the CustomLog configuration line. That tells you exactly where the https log errors will be posted. If all that looks configured right, then my guess is that you have some error occurring before the Virtual host is being setup and hence you're not getting any detailed error messages posted. In windows Event Viewer, you'll probably get the fairly meaningless high level error "Incorrect function", but not the detail message that you would like to better diagnose the actual problem.

1
  • Are you 100% certain the line SSLCertificateFile "${SRVROOT}/conf/ssl/myhost.crt"myhost.key" is accurate that worked in your case? May 1, 2020 at 1:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .