6

I have created a portable (relative paths) Apache installation. It works perfectly on my 32-bit system, but when I try to run it on a 64-bit system, it gives the following error:

>httpd -t
httpd: Syntax error on line … of …/httpd.conf: Cannot load …/modules/mod_ssl.so into server: %1 is not a valid Win32 application.

If I comment out the line that includes SSL.conf, then the server runs on the 64-bit system, but of course without SSL support.

I have tried searching for this but cannot find anything helpful. Does anybody know how to get Apache to use SSL on a 64-bit system (preferably in a way that is compatible with a 32-bit system)?

Synetech
  • 908
  • 1
  • 12
  • 27

2 Answers2

10

Using Process Monitor, I observed the file and registry entry accesses that Apache makes when loading.

I noticed that httpd loads the file libeay32.dll at the end of the trace (just before it errors out). I tried putting a copy of libeay32.dll from a 64-bit Apache package I got from ApacheLounge in Apache’s bin directory, but it still gave the same error. (I suppose that should not be a surprise, because the file it was previously loading was a already a 64-bit copy from some folder—which is in the PATH—where one of the laptop’s 64-bit drivers are installed.)

I then put a 32-bit copy of libeay32.dll (and ssleay32.dll) that I got from the standard package, et voilà! Apache runs with SSL support on a 64-bit system! Moreover, because the copy of libeay32.dll is 32-bits, it still runs on the 32-bit system without modification (i.e., no detecting the system and replacing files or even conf-file hacks)!

(I’m glad I put the error message in the title of the question because it will hopefully help direct others with this problem—which I struggled with for several months—to this page where they can finally find the solution. ☺)

Synetech
  • 908
  • 1
  • 12
  • 27
  • I had a similar problem and ended up using the `libeay32.dll (and ssleay32.dll` from a 32-bit version of PHP 5.5 (in my case I had to replace the ones that came with PHP v5.3 with the ones included in v5.5) – Costa May 24 '14 at 05:42
  • Helpful, I also downloaded 32 bits version and it is working for me. – asifaftab87 Jan 11 '16 at 14:56
  • 3
    same issue with mod_ssl and php 5.6 on wamp solve it by copy files libeay32.dll and ssleay32.dll from php 7.0.4 package. – Nikita Sep 07 '16 at 07:52
  • 2
    I copied `libesy` and `ssleay` from `php7` folder to apache/bin, and that solved my problem. – Exlord Feb 27 '17 at 06:56
0

We have 64bit mod_jk.so which can be downloaded from here by version. I hope it is helpful.

Airan
  • 101
  • 1