网页
综合
更新时间 2026-11-14 16:15:28
Compiling Apache for Microsoft Windows - Apache HTTP Server
自动蜘蛛
httpd.apache.org
正文约 6000 字
Modules | Directives | FAQ | Glossary | Sitemap
Apache HTTP Server Version 2.0
This document refers to the 2.0 version of Apache httpd, which is no longer maintained. Upgrade, and refer to the current version of httpd instead, documented at:
You may follow this link to go to the current version of this document.
Available Languages: en | ko
There are many important points before you begin compiling Apache. See Using Apache with Microsoft Windows before you begin.
Compiling Apache requires the following environment to be properly installed:
Make sure you have at least 50 MB of free disk space available. After installation Apache requires approximately 10 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.
Microsoft Visual C++ 5.0 or higher.
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 batch file:
"c:\Program Files\DevStudio\VC\Bin\vcvars32.bat"
The Windows Platform SDK.
Visual C++ 5.0 builds require an updated Microsoft Windows Platform SDK to enable some Apache features. For command line builds, the Platform SDK environment is prepared by the setenv batch file:
"c:\Program Files\Platform SDK\setenv.bat"
The Platform SDK files distributed with Visual C++ 6.0 and later are sufficient, so users of later version may skip this requirement.
The awk utility (awk, gawk or similar).
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 generating files. Brian Kernighan's http://cm.bell-labs.com/cm/cs/who/bwk/ site has a compiled native Win32 binary, http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe which you must save with the name awk.exe rather than awk95.exe.
[Optional] OpenSSL libraries (for mod_ssl and ab.exe with ssl support)
Caution: there are significant restrictions and prohibitions on the use and distribution of strong cryptography and patented intellectual property throughout the world. OpenSSL includes strong cryptography controlled by both export regulations and domestic law, as well as intellectual property protected by patent, in the United States and elsewhere. Neither the Apache Software Foundation nor the OpenSSL project can provide legal advise regarding possession, use, or distribution of the code provided by the OpenSSL project. Consult your own legal counsel, you are responsible for your own actions.
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 project (ab.exe with SSL support.) To prepare OpenSSL for both release and debug builds of Apache, and disable the patent protected features in OpenSSL, you might use the following build commands:
perl Configure VC-WIN32 perl util\mkfiles.pl >MINFO perl util\mk1mf.pl dll no-asm no-mdc2 no-rc5 no-idea VC-WIN32 >makefile.rel perl util\mk1mf.pl dll debug no-asm no-mdc2 no-rc5 no-idea VC-WIN32 >makefile.dbg perl util\mkdef.pl 32 libeay no-asm no-mdc2 no-rc5 no-idea >ms\libeay32.def perl util\mkdef.pl 32 ssleay no-asm no-mdc2 no-rc5 no-idea >ms\ssleay32.def nmake -f makefile.rel nmake -f makefile.dbg
Note; you can use the scripts in the ms\ subdirectory, however, it's rather tricky to force ms\do_masm.bat, for example, to perform the patent encumberances as mentioned above. Patches to add the $* argument list to the appropriate .bat lines in these scripts aren't incorporated, thus far.
[Optional] zlib sources (for mod_deflate)
Zlib must be installed into a srclib subdirectory named zlib, however those sources need not be compiled. The build system will compile the compression sources directly into the mod_deflate module. Zlib can be obtained from http://www.zlib.net/ -- mod_deflate is confirmed to build correctly with version 1.1.4. To use a later version of zlib, upgrade to Apache HTTP Server release 2.2 or later.
First, unpack the Apache distribution into an appropriate directory. Open a command-line prompt and cd to that directory.
The master Apache makefile instructions are contained in the Makefile.win file. To compile Apache on Windows NT, simply use one of the following commands to compiled the release or debug build, respectively:
Either command will compile Apache. The latter will include debugging information in the resulting files, making it easier to find bugs and track down problems.
Apache can also be compiled using VC++'s Visual Studio development environment. To simplify this process, a Visual Studio workspace, Apache.dsw, is provided. This workspace exposes the entire list of working .dsp projects that are required for the complete Apache binary release. It includes dependencies between the projects to assure that they are built in the appropriate order.
Open the Apache.dsw workspace, and select InstallBin (Release or Debug build, as desired) as the Active Project. InstallBin causes all related project to be built, and then invokes Makefile.win to move the compiled executables and dlls. You may personalize the INSTDIR= choice by changing InstallBin's Settings, General tab, Build command line entry. INSTDIR defaults to the /Apache2 directory. If you only want a test compile (without installing) you may build the BuildBin project instead.
The .dsp project files are distributed in Visual C++ 6.0 format. Visual C++ 5.0 (97) will recognize them. Visual C++ 7.0 (.net) must convert Apache.dsw plus the .dsp files into an Apache.sln plus .msproj files, be sure you reconvert the .msproj file if any of the source .dsp files change! This is really trivial, just open Apache.dsw in the VC++ 7.0 IDE once again.
Visual C++ 7.0 (.net) u
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。