Building Apache (2.0.x - 2.2.x) with SSL on Win32 platform

1 Introdution

Apache HTTP Server is an open-source HTTP server for modern operating systems including UNIX and Windows NT. It is a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.

Apache has been the most popular web server on the Internet since April 1996. The March 2006 Netcraft Web Server Survey found that 68.70% of the web sites on the Internet are using Apache, thus making it more widely used than all other web servers combined.

OpenSSL is a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library.

Unfortunately, the official binary distribution of Apache HTTP Server does not provide the SSL function at present, because US government has a problem with "strong crypto redistribution". However, people can always DIY for themself.

I have built Apache with SSL for every version of Apache (2.0.x - 2.2.x) and OpenSSL (0.9.6i - 0.9.8a) since 3 years ago.

2 Checklist

2.1 Required stuff to build OpenSSL

2.2 Required stuff to build Apache

2.3 Environment Variables

  • Put the following files's pathes in PATH: perl.exe, awk.exe, nasmw.exe, bison.exe, flex.exe, sed.exe, nmake.exe, mspdb60.dll.
  • Put MS Platform SDK before VC 6.0 in INCLUDE and LIB.

3 Building OpenSSL

  • Extract OpenSSL source code to a folder, e.g. c:\openssl
  • Set Perl configuration
        c:\openssl>perl Configure VC-WIN32
  • Build the Makefiles
        c:\openssl>ms\do_nasm
  • Build from the VC++ environment
        nmake -f ms\ntdll.mak
  • Test
        c:\openssl>cd out32dll
        c:\openssl\out32dll>..\ms\test

4 Building Apache

  • Extract Apache source code to a folder, e.g. c:\httpd-2.2.0
  • Copy OpenSSL libraries
        c:\httpd-2.2.0>mkdir srclib\openssl
        c:\httpd-2.2.0>xcopy/e openssl srclib\openssl
  • Compile
        nmake -f makefile.win SERVERNAME=myDomainName PORT=myPort 
            INSTDIR=myInstallDir installr
  • Delete unuseful files (Optional). The following language filess could be deleted if you don't speak these languages. *.de *.es *.euc-jp *.euc-kr *.fr *.ja *.jis *.ko *.koi8-r *.pt-br. *.pdb files could also be deleted if you don't debug.
1