X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=docs%2Fmanual%2Fplatform%2Fwin_compiling.html.en;h=112b7bc6521c48df1065981ea60ad31410fc10a8;hb=f0348fc28341bfdcce16cbf8c7d736de12ff85da;hp=6e7d42df6f1caecb09bc6b14267ffe74e54bdfb7;hpb=b55229f0bc1580738cf6d412d32707da0bbe1611;p=apache diff --git a/docs/manual/platform/win_compiling.html.en b/docs/manual/platform/win_compiling.html.en index 6e7d42df6f..112b7bc652 100644 --- a/docs/manual/platform/win_compiling.html.en +++ b/docs/manual/platform/win_compiling.html.en @@ -1,41 +1,52 @@ -
-Apache HTTP Server Version 2.3
-Apache HTTP Server Version 2.5
+There are many important points before you begin compiling - Apache. See Using Apache with Microsoft - Windows before you begin.
+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.
Disk Space
-Make sure you have at least 180 MB of free disk space + +
Make sure you have at least 200 MB of free disk space available. After installation Apache requires approximately - 70 MB of disk space, plus space for log and cache files, + 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 @@ -57,75 +69,93 @@
Microsoft Visual C++ (Microsoft Visual Studio) 6.0 or higher.
+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
file:
- "c:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32"
-
vcvars32.bat
script.
+
+ The Windows Platform SDK for Visual C++ 6.0 (97) or 7.0 (.NET)
+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.
Apache's APR and APR-util builds require an updated Microsoft
- Windows Platform SDK, from Feb 2003 or later, included in the
- Visual C++ 7.1 (Studio 2003) and later. For command line builds with
- Visual C++ 6.0 or 7.0, the Platform SDK environment is prepared by
- the setenv.bat
file:
+ "c:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32"
"c:\Program Files\Platform SDK\setenv.bat"
The Platform SDK files distributed with Visual C++ 6.0 and - Visual Studio .NET (2000) are no longer sufficient and cause many - compilation warnings and linkage errors. Users of Visual C++ 7.1 - (Studio 2003) and later versions (of the full product, not the - 'Visual Studio Express' flavor) may skip this requirement.
- -If using the GUI, either start msdev or devenv with the /setenv - flag (after invoking setenv.bat), or ensure the paths are correct - under the Tools -> Options -> (Projects ->) Directories - menu option. The Platform SDK installer will generally help you - configure this.
The awk utility (awk, gawk or similar).
+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://cm.bell-labs.com/cm/cs/who/bwk/
+ http://www.cs.princeton.edu/~bwk/btl.mirror/
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
.
awk.exe
(rather than
+ awk95.exe
).
Note that Developer Studio IDE will only find
- awk.exe
from the Executable path specified in the menu
- option Tools -> Options -> (Projects ->) Directories.
- Add the path for awk.exe
to this list, and your
- system PATH
environment variable, as needed.
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.gawk.exe
and that the file
+ (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
+ 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
+ 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
+ mod_deflate
is confirmed to work correctly with
version 1.2.3.
[Optional] OpenSSL libraries (for 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 Configuring and building OpenSSL requires perl to be installed. OpenSSL must be installed into a Note: It is not advisable to use zlib-dynamic, as that could
- pose a thread race condition. If building zlib on win32, be sure
- to adjust the resulting ms\ntdll.mak file to link to the full
- path of srclib\zlib\zdll.lib rather than zlib1.lib (that error in
- configuration of OpenSSL through 0.9.8h and earlier reflects older
- zlib 1.1 versions.) [Optional] Database libraries (for 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.; 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. See the README-win32.txt file for more hints on obtaining the
+ various database driver SDKs.
@@ -148,77 +179,140 @@
mod_ssl
and ab.exe
with ssl support)srclib
subdirectory
- named openssl
, obtained from
- http://www.openssl.org/source/, in order to compile
- mod_ssl
or the abs project (ab.exe
- enabled with SSL support.) To prepare OpenSSL for both
- release
and debug
builds of Apache,
- disable the patent encumbered features in OpenSSL, using zlib
- as compiled above you might use the following build commands: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-zlib VC-WIN32 -Ipath/to/srclib/zlib
+ 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
mod_dbd
+ and mod_authn_dbm
)
+ set DBD_LIST=sqlite3 pgsql oracle mysql
+
+ set DBM_LIST=db gdbm
+
First, unpack the Apache distribution into an appropriate
- directory. Open a command-line prompt and cd
to that
- directory.
The policy of the Apache HTTP Server project is to only release Unix sources. + Windows source packages made available for download have been supplied by + volunteers and may not be available for every release. You can still build + the server on Windows from the Unix source tarball with just a few additional + steps.
+ +
+ perl srclib\apr\build\lineends.pl
+
You can now build the server with the Visual Studio 6.0 development + environment using the IDE. Command-Line builds of the server are not + possible from Unix sources unless you export .mak files as explained + below. +
+ + -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 -
Makefile.win
is the top level Apache makefile.
+ To compile Apache on Windows, simply use one of the following commands
+ to build the release
or debug
flavor:
+ nmake /f Makefile.win _apacher
+ nmake /f Makefile.win _apached
+
Either command will compile Apache. The latter will disable optimization of the resulting files, making it easier to single step the code to find bugs and track down problems.
-You can add your apr-util dbd provider choices with the additional - make variable DBD_LIST, e.g. DBD_LIST="mysql oracle pgsql sqlite3" - to build these four providers. However it's necessary to have - the include headers in the INCLUDE path list, db client libraries - in the LIB path list, and the db client dll files in the PATH. The - specifics for each provider are an exercise left to the reader.
+You can add your apr-util dbd and dbm provider choices with the + additional make (environment) variables DBD_LIST and DBM_LIST, + see the comments about [Optional] Database libraries, above. + Review the initial comments in Makefile.win for additional options + that can be provided when invoking the build.
-/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.
The .dsp
project files are distributed in Visual Studio 6.0
+ (98) format. Visual C++ 5.0 (97) will recognize them. Visual Studio
+ 2002 (.NET) and later users must convert Apache.dsw
plus
+ the .dsp
files into an Apache.sln
plus
+ .msproj
files. Be sure you reconvert the .msproj
+ file again if its source .dsp
file changes! This is really
+ trivial, just open Apache.dsw
in the VC++ 7.0 IDE once again
+ and reconvert.
perl srclib\apr\build\cvtdsp.pl -2005
Visual C++ 7.0 (.net) users should also use the Build +
Visual Studio 2002 (.NET) and later users should also use the Build
menu, Configuration Manager dialog to uncheck both the Debug
- and Release
Solution modules abs, mod_ssl
- and mod_deflate
.
- These modules are built by invoking nmake
or the IDE directly
- with the BinBuild
target to build those modules conditionally
+ and Release
Solution modules abs
,
+ mod_deflate
and mod_ssl
components, as
+ well as every component starting with apr_db*
. These modules
+ are built by invoking nmake
, or the IDE directly with the
+ BinBuild
target, which builds those modules conditionally
if the srclib
directories openssl
and/or
- zlib
exist.
zlib
exist, and based on the setting of DBD_LIST
+ and DBM_LIST
environment variables.
+
+
+
+ Exported .mak
files pose a greater hassle, but they are
required for Visual C++ 5.0 users to build mod_ssl
,
abs (ab
with SSL support) and/or
- mod_deflate
. VC++ 7.0 (Visual Studio .NET) users
- also benefit, nmake
builds were faster than
- binenv
builds until the parallel compilation features
- introduced in Visual Studio 2005. Build the entire project from within
- the VC++ 5.0 or 6.0 IDE, preferably with mod_deflate, mod_ssl and abs,
- then use the Project Menu Export for all makefiles (preferably, with
- dependencies.) You must build the projects first in order to create
- all dynamic auto-generated targets, so that dependencies can be parsed
- correctly. Run the following command to fix the paths so they will build
+ mod_deflate
. The .mak files also support a broader
+ range of C++ tool chain distributions, such as Visual Studio Express.
You must first build all projects in order to create all dynamic
+ auto-generated targets, so that dependencies can be parsed correctly.
+ Build the entire project from within the Visual Studio 6.0 (98) IDE,
+ using the BuildAll
target, then use the Project Menu Export
+ for all makefiles (checking on "with dependencies".) Run the following
+ command to correct absolute paths into relative paths so they will build
anywhere:
@@ -294,71 +396,25 @@ nmake /f Makefile.win _apached
the current directory and below will be corrected, and the
timestamps adjusted to reflect the
.dsp
.
Always review the generated .mak
and .dep
+ files for Platform SDK or other local, machine specific file paths.
+ The DevStudio\Common\MSDev98\bin\
(VC6) directory contains
+ a sysincl.dat
file, which lists all exceptions. Update
+ this file (including both forward and backslashed paths, such as both
+ sys/time.h
and sys\time.h
) to ignore such
+ newer dependencies. Including local-install paths in a distributed
+ .mak
file will cause the build to fail completely.
If you contribute back a patch that revises project files, we must commit project files in Visual Studio 6.0 format. Changes should be simple, with minimal compilation and linkage flags that - will be recognized by all VC++ 5.0 through 7.0 environments.
- -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.dsp
srclib\apr\libapr.dsp
srclib\apr-util\uri\gen_uri_delims.dsp
srclib\apr-util\xml\expat\lib\xml.dsp
srclib\apr-util\aprutil.dsp
srclib\apr-util\libaprutil.dsp
srclib\pcre\dftables.dsp
srclib\pcre\pcre.dsp
srclib\pcre\pcreposix.dsp
server\gen_test_char.dsp
libhttpd.dsp
Apache.dsp
In addition, the modules\
subdirectory tree contains
- project files for the majority of the modules.
The support\
directory 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. Windows-specific support projects are
- broken out in the support\win32\
directory.
support\ab.dsp
support\htdigest.dsp
support\htpasswd.dsp
support\logresolve.dsp
support\rotatelogs.dsp
support\win32\ApacheMonitor.dsp
support\win32\wintty.dsp
Once Apache has been compiled, it needs to be installed in
its server root directory. The default is the
@@ -368,106 +424,83 @@ nmake /f Makefile.win _apached
dir automatically, use one of the following
nmake
commands:
-nmake /f Makefile.win installr INSTDIR=dir - -nmake /f Makefile.win installd INSTDIR=dir -
+ nmake /f Makefile.win installr INSTDIR=dir
+ nmake /f Makefile.win installd INSTDIR=dir
+
The dir argument to INSTDIR
gives
+
The dir argument to INSTDIR
provides
the installation directory; it can be omitted if Apache is
- to be installed into \Apache2
.
This will install the following:
- -dir\bin\httpd.exe
- Apache
- executabledir\bin\ApacheMonitor.exe
- Service
- monitor taskbar icon utilitydir\bin\htdigest.exe
- Digest auth
- password file utilitydir\bin\htdbm.exe
- SDBM auth
- database password file utilitydir\bin\htpasswd.exe
- Basic auth
- password file utility\Apache22
(of the current
+ drive).
- dir\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
- Link library files.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
- Developer Studio environment.BuildBin
- target project (or the command line _apacher
or
- _apached
target) prior to exporting the make files.
- Many files are autogenerated in the build process. Only a full
- build provides all of the dependent files required to build proper
- dependency trees for correct build behavior.In order to create distribution .mak
files, always
- review the generated .mak
(or .dep
)
- dependencies for Platform SDK or other garbage, machine specific
- includes. The DevStudio\SharedIDE\bin\
(VC5) or
- DevStudio\Common\MSDev98\bin\
(VC6) directory contains
- the sysincl.dat
file, which must list all exceptions.
- Update this file (including both forward and backslashed paths, such
- as both sys/time.h
and sys\time.h
) to ignore
- such dependencies. Including local-install paths in a distributed
- .mak
file will cause the build to fail completely. And
- don't forget to run srclib/apr/build/fixwin32mak.pl
in
- order to fix absolute paths within the .mak
files.
.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
+ Developer Studio environment.The primary documentation for this build mechanism is in the
+ README.cmake
file in the source distribution. Refer to that file
+ for detailed instructions.
Building httpd with cmake requires building APR and APR-util separately.
+ Refer to their README.cmake
files for instructions.
The primary limitations of the cmake-based build are inherited from the APR-util + project, and are listed below because of their impact on httpd:
+ +mod_charset_lite
and possibly some third-party modules
+ cannot be used.