Text of httpd.apache.org › docs › current › platform › win_compiling.html as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Compiling Apache httpd for Microsoft Windows - Apache HTTP Server Version 2.4

Modules | Directives | FAQ | Glossary | Sitemap | Report a bug Apache HTTP Server Version 2.4 Apache > HTTP Server > Documentation > Version 2.4 > Platform Specific Notes Compiling Apache httpd for Microsoft Windows Available Languages: en | fr | ko There are many important points to consider before you begin compiling Apache HTTP Server (httpd). See Using Apache HTTP Server on Microsoft Windows before you begin. httpd can be built on Windows using a cmake-based build system or with Visual Studio project files maintained by httpd developers.

The cmake-based build system directly supports more versions of Visual Studio but currently has considerable functional limitations. Building httpd with the included Visual Studio project files Building httpd with cmake Building httpd with the included Visual Studio project files ¶ Requirements Compiling Apache requires the following environment to be properly installed: Disk Space Make sure you have at least 200 MB of free disk space available.

After installation Apache requires approximately 80 MB of disk space, plus space for log and cache files, which can grow rapidly. The actual disk space requirements will vary considerably based on your chosen configuration and any third-party modules or libraries, especially when OpenSSL is also built. Because many files are text and very easily compressed, NTFS filesystem compression cuts these requirements in half. Appropriate Patches The httpd binary is built with the help of several patches to third party packages, which ensure the released code is buildable and debuggable.

These patches are available and distributed from http://www.apache.org/dist/httpd/binaries/win32/patches_applied/ and are recommended to be applied to obtain identical results as the "official" ASF distributed binaries. Microsoft Visual C++ 6.0 (Visual Studio 97) or later. Apache can be built using the command line tools, or from within the Visual Studio IDE Workbench. The command line build requires the environment to reflect the PATH , INCLUDE , LIB and other variables that can be configured with the vcvars32.bat script.

You may want the Visual Studio Processor Pack for your older version of Visual Studio, or a full (not Express) version of newer Visual Studio editions, for the ml.exe assembler. This will allow you to build OpenSSL, if desired, using the more efficient assembly code implementation. Only the Microsoft compiler tool chain is actively supported by the active httpd contributors. Although the project regularly accepts patches to ensure MinGW and other alternative builds work and improve upon them, they are not actively maintained and are often broken in the course of normal development.

Updated Microsoft Windows Platform SDK, February 2003 or later. An appropriate Windows Platform SDK is included by default in the full (not express/lite) versions of Visual C++ 7.1 (Visual Studio 2002) and later, these users can ignore these steps unless explicitly choosing a newer or different version of the Platform SDK. To use Visual C++ 6.0 or 7.0 (Studio 2000 .NET), the Platform SDK environment must be prepared using the setenv.bat script (installed by the Platform SDK) before starting the command line build or launching the msdev/devenv GUI environment.

Installing the Platform SDK for Visual Studio Express versions (2003 and later) should adjust the default environment appropriately. "c:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32" "c:\Program Files\Platform SDK\setenv.bat" Perl and awk Several steps recommended here require a perl interpreter during the build preparation process, but it is otherwise not required. To install Apache within the build system, several files are modified using the awk.exe utility. awk was chosen since it is a very small download (compared with Perl or WSH/VB) and accomplishes the task of modifying configuration files upon installation.

Brian Kernighan's http://www.cs.princeton.edu/~bwk/btl.mirror/ site has a compiled native Win32 binary, http://www.cs.princeton.edu/~bwk/btl.mirror/awk95.exe which you must save with the name awk.exe (rather than awk95.exe ). If awk.exe is not found, Makefile.win's install target will not perform substitutions in the installed .conf files. You must manually modify the installed .conf files to allow the server to start.

Search and replace all "@token@" tags as appropriate. The Visual Studio IDE will only find awk.exe from the PATH, or executable path specified in the menu option Tools -> Options -> (Projects ->) Directories. Ensure awk.exe is in your system path. Also note that if you are using Cygwin tools ( http://www.cygwin.com/ ) the awk utility is named gawk.exe and that the file awk.exe is really a symlink to the gawk.exe file.

The Windows command shell does not recognize symlinks, and because of this building InstallBin will fail. A workaround is to delete awk.exe from the cygwin installation and copy gawk.exe to awk.exe . Also note the cygwin/mingw ports of gawk 3.0.x were buggy, please upgrade to 3.1.x before attempting to use any gawk port. [Optional] zlib library (for mod_deflate ) Zlib must be installed into a srclib subdirectory named zlib .

This must be built in-place. Zlib can be obtained from http://www.zlib.net/ -- the mod_deflate is confirmed to work correctly with version 1.2.3. nmake -f win32\Makefile.msc nmake -f win32\Makefile.msc test [Optional] OpenSSL libraries (for mod_ssl and ab.exe with ssl support) The OpenSSL library is cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software.

BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information. Configuring and building OpenSSL requires perl to be installed. OpenSSL must be installed into a srclib subdirectory named openssl , obtained from http://www.openssl.org/source/ , in order to compile mod_ssl or the abs.exe project, which is ab.c with SSL support enabled.

To prepare OpenSSL to be linked to Apache mod_ssl or abs.exe, and disable patent encumbered features in OpenSSL, you might use the following build commands: perl Configure no-rc5 no-idea enable-mdc2 enable-zlib VC-WIN32 -Ipath/to/srclib/zlib -Lpath/to/srclib/zlib ms\do_masm.bat nmake -f ms\ntdll.mak It is not advisable to use zlib-dynamic, as that transfers the cost of deflating SSL streams to the first request which must load the zlib dll.

Note the suggested patch enables the -L flag to work with windows builds, corrects the name of zdll.lib and ensures .pdb files are generated for troubleshooting. If the assembler is not installed, you would add no-asm above and use ms\do_ms.bat instead of the ms\do_masm.bat script. [Optional] Database libraries (for mod_dbd and mod_authn_dbm ) The apr-util library exposes dbm (keyed database) and dbd (query oriented database) client functionality to the httpd server and its modules, such as authentication and authorization.

The sdbm dbm and odbc dbd providers are compiled unconditionally. The dbd support includes the Oracle instantclient package, MySQL, PostgreSQL and sqlite. To build these all, for example, set up the LIB to include the library path, INCLUDE to include the headers path, and PATH to include the dll bin path of all four SDK's, and set the DBD_LIST environment variable to inform the build which client driver SDKs are installed correctly, e.g.; set DBD_LIST=sqlite3 pgsql oracle mysql Similarly, the dbm support can be extended with DBM_LIST to build a Berkeley DB provider (db) and/or gdbm provider, by similarly configuring LIB, INCLUDE and PATH first to ensure the client library libs and headers are available. set DBM_LIST=db gdbm Depending on the choice of database distributions, it may be necessary to change the actual link targ

The rest of this page is on the live site.