win_compiling.html revision 54c595cd9cb48e6ff451b44aef80a49490ac92d7
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Compiling Apache for Microsoft Windows</TITLE>
</HEAD>
<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
<BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#000080"
ALINK="#FF0000"
>
<!--#include virtual="header.html" -->
<H1 ALIGN="CENTER">Compiling Apache for Microsoft Windows</H1>
<P>There are many important points before you begin compiling Apache.
before you begin.</P>
<P>Compiling Apache requires Microsoft Visual C++ 5.0 (or later) to be
properly installed. It is easiest to compile with the command-line tools
(nmake, <EM>etc.</EM>..). Consult the VC++ manual to determine how to install
them. Be especially aware that the vcvars32.bat file from the
command-line environment for command-line builds!</P>
<P>First, unpack the Apache distribution into an appropriate
directory. Open a command-line prompt and cd to that directory.</P>
<P>The master Apache makefile instructions are contained in the
use one of the following commands:<P>
<UL>
</UL>
<P>These will both compile Apache. The latter will include debugging
information in the resulting files, making it easier to find bugs and
track down problems.</P>
<P>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.</P>
in VisualStudio 6.0 (98) format.</STRONG> In fact you may build with
VisualStudio 5.0 (97) but you must first use the perl script command:</P>
<PRE>
cd srclib\apr\build
</PRE>
<P>Without running the script you will be able to load and build Apache,
however VisualStudio 97 in particular will not recognize the /ZI flag
to the C compiler for the debugging mode. This script toggles the
new /ZI flag back to /Zi for Debug builds, among other adjustments.
reverse the adjustments, and we ask you to do so before submitting
patches against any .dsp project files.</P>
.dsp projects of the Apache server in the following sequence:</P>
<OL>
</OL>
In addition, the <CODE>os\win32</CODE> subdirectory contains
project files for the optional modules.
<OL>
</OL>
The <CODE>support\</CODE> 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.</P>
<OL>
</OL>
<P>Once Apache has been compiled, it needs to be installed in its server
root directory. The default is the <CODE>\Apache</CODE>
directory, on the current hard drive. </P>
<P>To build and install all the files into the desired folder <EM>dir</EM>
automatically, use one the following nmake commands:
<UL>
(for release build)
(for debug build)
</UL>
The <EM>dir</EM> argument to INSTDIR gives the installation directory; it
can be omitted if Apache is to be installed into <SAMP>\Apache</SAMP>.</P>
<P>This will install the following:</P>
<UL>
<LI><CODE><EM>dir</EM>\modules\ApacheModule*.dll</CODE> - Loadable Apache
modules
<LI><CODE><EM>dir</EM>\bin\*.exe</CODE> - Administrator support executables
<LI><CODE><EM>dir</EM>\conf</CODE> - Empty configuration directory
<LI><CODE><EM>dir</EM>\logs</CODE> - Empty logging directory
</UL>
<P>If you do not have nmake, or wish to install in a different directory,
be sure to use a similar naming scheme, or use the following shortcut.</P>
<P>To simplify the process, dependencies between all projects
are defined in the Microsoft VisualStudio workspace file:
<PRE>
</PRE>
<P>This assures that lower-level sources are rebuilt from within
VisualStudio. The top level project is InstallBin, which invokes
Makefile.win to move the compiled executables and dlls. You may
personalize the INSTDIR= setting by changing the Settings for
InstallBin, Build command line entry under the General tab.
INSTDIR defaults to the same directory as the httpd source.</P>
<P><STRONG>Warning about building Apache from the development tree</STRONG></P>
<P>Only the .dsp files are distributed 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 withing the Microsoft DeveloperStudio environment.</P>
<P>Before running the server you must fill out the conf directory.
Copy the *.conf-dist-win from the distribution conf directory
and rename *.conf. Edit the @@ServerRoot@@ entries to your
actual server root (for example "C:\apache"). Copy over
<!--#include virtual="footer.html" -->
</BODY>
</HTML>