From 965ad10aef81a922a5aef5b9d382dbd2e5831353 Mon Sep 17 00:00:00 2001
From: "William A. Rowe Jr" 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
@@ -55,69 +56,89 @@
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: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:
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.[Optional] zlib library (for
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
@@ -148,41 +170,81 @@
[Optional] OpenSSL libraries (for 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.
+ +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
- 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:
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:
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.
+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:
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.
@@ -241,48 +296,56 @@ nmake /f Makefile.win _apached/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.
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, nmake
or the IDE directly
- with the BinBuild
target to build those modules conditionally
+ and Release
Solution modules abs
,
+ 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 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
+
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:
.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.
+ can be recognized by all Visual Studio 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
@@ -369,100 +386,29 @@ 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 -
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 utilitydir\bin\logresolve.exe
- Log file
- dns name lookup utility\Apache22
(of the current
+ drive).
- dir\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.This document explains how to install, configure and run - Apache 2.0 under Microsoft Windows. If you find any bugs, or - wish to contribute in other ways, please use our bug reporting - page.
+ Apache 2.3 under Microsoft Windows. If you have questions after + reviewing the documentation (and any event and error logs), you + should consult the peer-supported + users' mailing + list.This document assumes that you are installing a binary distribution of Apache. If you want to compile Apache yourself (possibly to help with development or tracking down bugs), see Compiling Apache for Microsoft Windows.
- -Because of the current versioning policies on Microsoft - Windows operating system families, this document assumes the - following:
-The primary Windows platform for running Apache 2.0 is Windows - NT. The binary installer only works with the x86 family of - processors, such as Intel and AMD processors. Running Apache on - Windows 9x is not thoroughly tested, and it is never recommended on - production systems. -
- -On all operating systems, TCP/IP networking must be installed - and working. If running on Windows 95, the Winsock 2 upgrade must - be installed. Winsock 2 for Windows 95 can be downloaded from here. -
+The primary Windows platform for running Apache 2.3 is Windows + 2000 or later. The binary installer only works with the x86 family + of processors, such as Intel and AMD processors. Always obtain and + install the current service pack to avoid operating system bugs.
-On Windows NT 4.0, installing Service Pack 6 is strongly - recommended, as Service Pack 4 created known issues with TCP/IP - and Winsock integrity that were resolved in later Service Packs.
+For Windows installations you should download the version of
Apache for Windows with the .msi
extension. This is a
single Microsoft Installer file, which contains a ready-to-run
- version of Apache. There is a separate .zip
file,
- which contains only the source code. You can compile Apache
- yourself with the Microsoft Visual C++ (Visual Studio) tools.
.zip
file,
+ which contains only the source code, see the summary above.
You need Microsoft Installer 1.2 or above for the installation - to work. On Windows 9x you can update your Microsoft Installer to - version 2.0 here - and on Windows NT 4.0 and 2000 the version 2.0 update can be found - here. - Windows XP does not need this update.
+You need Microsoft Installer 2.0 or above for the installation + to work. For Windows NT 4.0 and 2000 refer to Microsoft's article + KB 292539. + Windows XP and later do not require this update.
-Note that you cannot install two versions of Apache 2.0 on the +
Note that you cannot install two versions of Apache 2.3 on the same computer with the binary installer. You can, however, install a version of the 1.3 series and a version of the - 2.0 series on the same computer without problems. If you need to - have two different 2.0 versions on the same computer, you have to + 2.3 series on the same computer without problems. If you need to + have two different 2.3 versions on the same computer, you have to compile and install Apache from the source.
@@ -192,7 +166,7 @@The main differences in Apache for Windows are:
Because Apache for Windows is multithreaded, it does not - use a separate process for each request, as Apache does on Unix. + use a separate process for each request, as Apache can on Unix. Instead there are usually only two Apache processes running: a parent process, and a child which handles the requests. Within the child process each request is handled by a separate thread. @@ -201,12 +175,12 @@
The process management directives are also different:
MaxRequestsPerChild 0
,
- causes the child process to never exit.
MaxRequestsPerChild 0
,
+ unless instructed to change the behavior to overcome a memory leak
+ in third party modules or in-process applications.
ThreadsPerChild 50
.ThreadsPerChild 150
, but this mut be adjusted to
+ reflect the greatest anticipated number of simultanious
+ connections to accept.The directives that accept filenames as arguments must use Windows filenames instead of Unix ones. However, because Apache - uses Unix-style names internally, you must use forward slashes, - not backslashes. Drive letters can be used; if omitted, the drive - with the Apache executable will be assumed.
While filenames are generally case-insensitive on Windows, URLs are still treated internally as case-sensitive @@ -247,6 +225,16 @@ RewriteRule (.*) ${lowercase:$1} [R,L]
When running, Apache needs write access only to the logs + directory and any configured cache directory tree. Due to the + issue of case insensitive and short 8.3 format names, Apache must + validate all path names given. This means that each directory + which Apache evaluates, from the drive root up to the directory + leaf, must have read, list and traverse directory permissions. + If Apache2.3 is installed at C:\Program Files, then the root + directory, Program Files and Apache2.3 must all be visible + to Apache.
Apache for Windows contains the ability to load modules at runtime, without recompiling the server. If Apache is compiled normally, it will install a number of optional modules in the @@ -264,11 +252,11 @@ loadable modules is also available.
Apache can also load ISAPI (Internet Server Application - Programming Interface) extensions (i.e. internet server - applications), such as those used by Microsoft IIS and other - Windows servers. More information - is available. Note that Apache cannot load - ISAPI Filters.
When running CGI scripts, the method Apache uses to find the interpreter for the script is configurable using the @@ -283,15 +271,11 @@
Any errors during Apache startup are logged into the
Windows event log when running on Windows NT. This mechanism
- acts as a backup for those situations where Apache cannot even
- access the normally used error.log
file. You can
- view the Windows event log by using the Event Viewer application
- on Windows NT 4.0, and the Event Viewer MMC snap-in on newer
- versions of Windows.
error.log
file. You can
+ review the Windows Applicat Event Log by using the Event Viewer,
+ e.g. Start - Settings - Control Panel - Administrative Tools
+ - Event Viewer.
@@ -299,9 +283,6 @@
Apache can be run as a service on Windows NT. There is some - highly experimental support for similar behavior on Windows 9x.
-You can install Apache as a service automatically during the installation. If you chose to install for all users, the installation will create an Apache service for you. If you specify @@ -340,7 +321,7 @@
If you use the first command without any special parameters except
- -k install
, the service will be called Apache2
+ -k install
, the service will be called Apache2.3
and the configuration will be assumed to be conf\httpd.conf
.
Normal starting, restarting and shutting down of an Apache
service is usually done via the Apache Service Monitor, by using
- commands like NET START Apache2
and NET STOP
- Apache2
or via normal Windows service management. Before
+ commands like NET START Apache2.3
and NET STOP
+ Apache2.3
or via normal Windows service management. Before
starting Apache as a service by any means, you should test the
service's configuration file by using:
You may want to create a separate account for running Apache - service(s). Especially, if you have to access network resources - via Apache, this is strongly recommended.
+It is recommended that users create a separate account for running + Apache service(s). If you have to access network resources via Apache, + this is required.
logs
subdirectory, where the
user has to have at least change (RWXD) rights.If you allow the account to log in as a user and as a service, - then you can log on with that account and test that the account has the - privileges to execute the scripts, read the web pages, and that + then you can log on with that account and test that the account has + the privileges to execute the scripts, read the web pages, and that you can start Apache in a console window. If this works, and you have followed the steps above, Apache should execute as a service with no problems.
@@ -460,7 +441,7 @@ Windows Control Panel, you may get the following message:There is some support for Apache on Windows 9x to behave in a - similar manner as a service on Windows NT. It is highly - experimental. It is not of production-class reliability, - and its future is not guaranteed. It can be mostly regarded as - a risky thing to play with - proceed with caution!
- -There are some differences between the two kinds of services - you should be aware of:
- -Apache will attempt to start and if successful it will run - in the background. If you run the command
- -via a shortcut on your desktop, for example, then if the - service starts successfully, a console window will flash up but - it immediately disappears. If Apache detects any errors on startup - such as incorrect entries in the httpd.conf configuration file, - the console window will remain visible. This will display an error - message which will be useful in tracking down the cause of the - problem.
Windows 9x does not support NET START
or
- NET STOP
commands. You must control the Apache
- service on the command prompt via the -k
switches.
-
Apache and Windows 9x offer no support for running Apache - as a specific user with network privileges. In fact, Windows 9x - offers no security on the local machine, either. This is the - simple reason because of which the Apache Software Foundation - never endorses use of a Windows 9x -based system as a public - Apache server. The primitive support for Windows 9x exists only - to assist the user in developing web content and learning the - Apache server, and perhaps as an intranet server on a secured, - private network.
Once you have confirmed that Apache runs correctly as a - console application you can install, control and uninstall the - pseudo-service with the same commands as on Windows NT. You can - also use the Apache Service Monitor to manage Windows 9x - pseudo-services.
- +If you are having problems with the service, it is suggested + you follow the instructions below to try starting httpd.exe from + a console window, and work out the errors before struggling to + start it as a service again.
You can also run Apache via the shortcut Start Apache in Console
placed to Start Menu --> Programs --> Apache HTTP Server
- 2.0.xx --> Control Apache Server
during the installation.
+ 2.3.xx --> Control Apache Server during the installation.
This will open a console window and start Apache inside it. If you
don't have Apache installed as a service, the window will remain
visible until you stop Apache by pressing Control-C in the console
@@ -669,7 +606,7 @@
Correspondingly, if you chose to install Apache for the current @@ -678,7 +615,7 @@ logged on:
This key is compiled into the server and can enable you to test
@@ -703,7 +640,6 @@
location it is vital that you update the
httpd.conf
file to reflect the new location.
Because Apache cannot share the same port with another TCP/IP application, you may need to stop, uninstall or reconfigure certain other services before running Apache. These conflicting - services include other WWW servers and some firewall implementations. -
- + services include other WWW servers, some firewall implementations, + and even some client applications (such as Skype) which will use port + 80 to attempt to bypass firewall issues.