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;
"c:\Program Files\DevStudio\VC\Bin\vcvars32.bat"
"c:\Program Files\Platform SDK\setenv.bat"The Platform SDK files distributed with Visual C++ 6.0 and later are sufficient, so those users may skip this requirement.
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:
nmake /f Makefile.win _apacher
nmake /f Makefile.win _apached
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 VisualStudio development environment. To simplify this process, a VisualStudio 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 choose InstallBin (Release or Debug build, as desired) as the Active Project. InstallBin causes all related project to be build, 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.
The .dsp project files are distributed in Visual C++ 6.0 format. Visual C++ 5.0 (97) will recognize them with the single exception of the /ZI flag (which corresponds to the VC 5.0 /Zi flag for debugging symbols.) To quickly prepare the .dsp files for the Visual Studio 5.0 (97), you can run this command from the top-level httpd-2.0 directory:
perl srclib\apr\build\cvtdsp.pl -5
You must type this command from the top level
directory of the httpd source tree. Every VC6 .dsp project file
within the current directory and below will be listed as it is
converted. If you contribute back a patch that revises project
files, please convert them back with the the -6 option instead
of -5, which returns the project files to Visual Studio 6.0
format.The Apache.dsw workspace and makefile.win nmake script both build the .dsp projects of the Apache server in the following sequence:
srclib\apr\apr.dspsrclib\apr\libapr.dspsrclib\apr-util\uri\gen_uri_delims.dspsrclib\apr-util\aprutil.dspsrclib\apr-util\libaprutil.dspsrclib\pcre\dftables.dspsrclib\pcre\pcre.dspsrclib\pcre\pcreposix.dspsrclib\expat-lite\libexpat.dspserver\gen_test_char.dsplibhttpd.dspApache.dspIn addition, the os\win32 subdirectory contains
project files for the optional modules.
modules\aaa\mod_auth_dbm.dspmodules\aaa\mod_auth_anon.dspmodules\aaa\mod_auth_digest.dspmodules\cache\mod_file_cache.dspmodules\dav\fs\mod_dav_fs.dspmodules\dav\main\mod_dav.dspmodules\generators\mod_info.dspmodules\generators\mod_status.dspmodules\mappers\mod_rewrite.dspmodules\mappers\mod_speling.dspmodules\metadata\mod_usertrack.dspmodules\metadata\mod_cern_meta.dspmodules\metadata\mod_headers.dspmodules\metadata\mod_expires.dspmodules\ssl\mod_ssl.dspmodules\tls\mod_tls.dspThe support\ folder contains project files for
additional programs that are not part of the Apache runtime,
but are used by the administrator to test Apache and maintain
password and log files.
support\ab.dspsupport\htdigest.dspsupport\htpasswd.dspsupport\logresolve.dspsupport\rotatelogs.dspsupport\win32\wintty.dspOnce Apache has been compiled, it needs to be installed in
its server root directory. The default is the
\Apache2 directory, of the same drive.
To build and install all the files into the desired folder dir automatically, use one the following nmake commands:
nmake /f Makefile.win installr INSTDIR=dir
nmake /f Makefile.win installd INSTDIR=dir
The dir argument to INSTDIR gives the installation
directory; it can be omitted if Apache is to be installed into
\Apache2.This will install the following:
dir\bin\Apache.exe - Apache
executabledir\bin\htdigest.exe - Digest auth
password file utilitydir\bin\htpasswd.exe - Basic auth
password file utilitydir\bin\logresolve.exe - Log file
dns name lookup utilitydir\bin\rotatelogs.exe - Log file
cycling utilitydir\bin\wintty.exe - Console window
utilitydir\bin\libapr.dll - Apache
Portable Runtime shared librarydir\bin\libaprutil.dll - Apache
Utility Runtime shared librarydir\bin\libhttpd.dll - Apache Core
librarydir\modules\mod_*.so - Loadable
Apache modulesdir\conf - Configuration
directorydir\logs - Empty logging
directorydir\include - C language header
filesdir\lib - Static Link library
filesdir\libexec - DLL link library
filesWarning about building Apache from the development tree
Only the .dsp files are maintained between release builds. The .mak files are NOT regenerated, due to the tremendous waste of reviewer's time. Therefore, you cannot rely on the NMAKE commands above to build revised .dsp project files unless you then export all .mak files yourself from the project. This is unnecessary if you build from within the Microsoft DeveloperStudio environment.