From: André Malo 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; 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
- 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 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) 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 explicitly, only if the
- srclib directories openssl and/or zlib exist. 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 (.net) users
- also benefit, nmake builds are faster than binenv builds.
- Build the entire project from within the VC++ 5.0 or 6.0 IDE,
- then use the Project Menu Export for all makefiles.
- 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 anywhere; You must type this command from the top level
- directory of the httpd source tree. Every .mak and .dep project
- file within the current directory and below will be corrected,
- and the timestamps adjusted to reflect the .dsp. 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: In addition, the The Once Apache has been compiled, it needs to be installed in
- its server root directory. The default is the
- To build and install all the files into the desired folder
- dir automatically, use one of the following nmake
- commands: This will install the following: Warning about building Apache from the development
- tree Note; 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
- Developer Studio environment. Note: it is very worthwhile to build the
- 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 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 include 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. Apache HTTP Server Version 2.0 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: Disk Space 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 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
+ 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 [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 [Optional] zlib sources (for Zlib must be installed into a First, unpack the Apache distribution into an appropriate
+ directory. Open a command-line prompt and The master Apache makefile instructions are contained in the
+ 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, Open the The Visual C++ 7.0 (.net) users should also use the Build
+ menu, Configuration Manager dialog to uncheck both the Exported You must type this command from the top level
+ directory of the 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 In addition, the The Once Apache has been compiled, it needs to be installed in
+ its server root directory. The default is the
+ To build and install all the files into the desired folder
+ dir automatically, use one of the following
+ The dir argument to This will install the following: In order to create distribution 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: Disk Space 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 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
+ 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 [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 [Optional] zlib sources (for Zlib must be installed into a First, unpack the Apache distribution into an appropriate
+ directory. Open a command-line prompt and The master Apache makefile instructions are contained in the
+ 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, Open the The Visual C++ 7.0 (.net) users should also use the Build
+ menu, Configuration Manager dialog to uncheck both the Exported You must type this command from the top level
+ directory of the 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 In addition, the The Once Apache has been compiled, it needs to be installed in
+ its server root directory. The default is the
+ To build and install all the files into the desired folder
+ dir automatically, use one of the following
+ The dir argument to This will install the following: In order to create distribution Apache HTTP Server Version 2.0 Apache can be run as a service on Windows NT/2000. (There is
+ also some HIGHLY EXPERIMENTAL support for similar behavior on
+ Windows 95/98, introduced with Apache
+ 1.3.13). Installing Apache as a service should only be done once you
+ can successfully run it in a console window. See Using Apache with Microsoft Windows
+ before you attempt to install or run Apache as a service.
+ Changes to the To start Apache as a service, you first need to install it
+ as a service. Multiple Apache services can be installed, each
+ with a different name and configuration. To install the default
+ Apache service named "Apache", run the "Install Apache as
+ Service (NT only)" option from the Start menu. Once this is
+ done you can start the "Apache" service by opening the Services
+ window (in the Control Panel), selecting Apache, then clicking
+ on Start. Apache will now be running, hidden in the background.
+ You can later stop Apache by clicking on Stop. As an
+ alternative to using the Services window, you can start and
+ stop the "Apache" service from the command line with See Controlling Apache as a Service
+ for more information on installing and controlling Apache
+ services. After starting Apache as a service (or if you have trouble
+ starting it) you can test it using the same procedure as for running in a
+ console window. Remember to use the command: to assure you are using the service's configuration. You can install Apache as a Windows NT service as
+ follows: To install a service to use a particular configuration,
+ specify the configuration file when the service is
+ installed: To remove an Apache service, use: The default "service name", if one is not specified, is
+ "Apache". Once a service is installed, you can use the To test a service's configuration file: To start a console Apache using a service's configuration
+ file: Prior to Apache release 1.3.13, the dependencies required to
+ successfully start an installed service were not configured.
+ After installing a service using earlier versions of Apache,
+ you must follow these steps: If you are using COM or DCOM components from a third party
+ module, ISAPI, or other add-in scripting technologies such as
+ ActiveState Perl, you may also need to add the entry Rpcss to
+ the DependOnService list. To avoid exposing the TCP port 135
+ when it is unnecessary, Apache does not create that entry upon
+ installation. Follow the directions above to find or create the
+ DependOnService value, double click that value if it already
+ exists, and add the Rpcss entry to the list. When Apache is first installed as a service (e.g. with the
+ NEVER grant network privileges to the SYSTEM
+ account! Create a new user account instead, grant the
+ appropriate privileges to that user, and use the the "Log On
+ As:" option. Select the Start Menu -> Settings -> Control
+ Panel -> Services -> apache service ... and click the
+ "Startup" button to access this setting. The SYSTEM account has no privileges to the network, so
+ shared pages or a shared installation of Apache is invisible to
+ the service. If you intend to use any network
+ resources, the following steps should help: If you allow the account to log in as a user, then you can
+ log in yourself 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. When starting Apache as a service you may encounter an error
+ message from Windows service manager. For example if you try to
+ start Apache using the Services applet in Windows Control Panel
+ you may get the following message: You will get this error if there is any problem starting
+ Apache. In order to see what is causing the problem you should
+ follow the instructions for Running Apache for Windows from the
+ Command Line. Also, Apache 1.3.13 now records startup errors in the
+ Application Event Log under Windows NT/2000, if Apache is run
+ as a service. Run the Event Viewer and select Log ...
+ Application to see these events. For details on controlling Apache service from the command
+ line, please refer to console
+ command line section. Multiple instances of Apache can be installed and run as
+ services. Signal an installed Apache service to start, restart,
+ or shutdown/stop as follows: For the default "Apache" service, the In addition, you can use the native NT Again, quotes are only required if the service name contains
+ spaces. There is some support for Apache on Windows 95/98 to behave
+ in a similar manner as a service on Windows NT/2000. It is
+ highly experimental, if it works (at all) the Apache
+ Sofware Foundation will not attest to its reliability or
+ future support. Proceed at your own risk! Once you have confirmed that Apache runs correctly at the Command Prompt you can install,
+ control and uninstall it with the same commands as the Windows
+ NT/2000 version. There are, however, significant differences that you should
+ note: 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
+ immediately disappears. If Apache detects any errors on startup
+ such as a incorrect entries in the Windows 95/98 does not support Apache and Windows 95/98 offer no support for running the
+ Apache service as a specific user with network privileges. In
+ fact, Windows 95/98 offers no security on the local machine,
+ either. This is the simple reason that the Apache Software
+ Foundation never endorses the use of Windows 95/98 as a public
+ httpd server. These facilities exist only to assist the user in
+ developing web content and learning the Apache server, and
+ perhaps as a intranet server on a secured, private network. Apache can be run as a service on Windows NT/2000. (There is
also some HIGHLY EXPERIMENTAL support for similar behavior on
@@ -24,20 +18,19 @@
can successfully run it in a console window. See Using Apache with Microsoft Windows
before you attempt to install or run Apache as a service.
- Changes to the httpd.conf file should always be followed by
- starting Apache as a console window. If this succeeds, the
- service should succeed.Compiling Apache for Microsoft Windows
-
- Requirements
-
-
-
-
-
-
- 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.
-
-
-
- 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"
-
-
-
- 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.
-
- Note that the Windows Platform SDK update
- is required to enable all supported mod_isapi features.
- Without a recent update, Apache will issue warnings under
- MSVC++ 5.0 that some mod_isapi features will be disabled.
- Look for the update at
- http://msdn.microsoft.com/downloads/sdks/platform/platform.asp.
-
-
-
- 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.
-
- Note that Developer Studio IDE will only find awk.exe from
- the Tools menu Options... Directories tab
- (the Projects - VC++ Directories pane in Developer Studio 7.0)
- listing Executable file paths. Add the path for awk.exe to this
- list, and your system PATH environment variable, as needed.
-
- Also note that if you are using Cygwin (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 that
- building InstallBin will fail. A workaround is to delete awk.exe from
- the cygwin installation and rename gawk.exe to awk.exe.
-
-
-
- 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 0.9.6, you might use the following build commands;
-
- perl util\mkfiles.pl >MINFO
- perl util\mk1mf.pl dll no-asm no-mdc2 no-rc5 no-idea VC-WIN32 >makefile
- 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
- nmake -f makefile.dbg
-
-
-
- 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.gzip.org/zlib/ -- mod_deflate is confirmed to
- build correctly with version 1.1.4.
-
- Command-Line
- Build
-
- 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
-
-
- Developer
- Studio Workspace IDE Build
-
-
- perl srclib\apr\build\fixwin32mak.pl
-
- Project
- Components
-
-
-
-
- srclib\apr\apr.dspsrclib\apr\libapr.dspsrclib\apr-util\uri\gen_uri_delims.dspsrclib\apr-util\xml\expat\lib\xml.dspsrclib\apr-util\aprutil.dspsrclib\apr-util\libaprutil.dspsrclib\pcre\dftables.dspsrclib\pcre\pcre.dspsrclib\pcre\pcreposix.dspserver\gen_test_char.dsplibhttpd.dspApache.dspmodules\ subdirectory tree contains
- project files for the majority of the modules.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.dspsupport\htdigest.dspsupport\htpasswd.dspsupport\logresolve.dspsupport\rotatelogs.dspsupport\win32\ApacheMonitor.dspsupport\win32\wintty.dsp\Apache2 directory, of the same drive.
- 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.
-
-
-
-
-
-
- dir\bin\Apache.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 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
Compiling Apache for Microsoft Windows
+
+ Requirements
+
+
+
+
+
+
+ PATH,
+ INCLUDE, LIB and other variables
+ that can be configured with the vcvars32 batch file:
+ "c:\Program Files\DevStudio\VC\Bin\vcvars32.bat"
+ setenv batch file:
+ "c:\Program Files\Platform SDK\setenv.bat"
+ mod_isapi features.
+ Without a recent update, Apache will issue warnings under
+ MSVC++ 5.0 that some mod_isapi features
+ will be disabled. Look for the update at http://msdn.microsoft.com/downloads/sdks/platform/platform.asp.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.awk.exe from the Tools menu Options... Directories
+ tab (the Projects - VC++ Directories pane in Developer Studio 7.0)
+ listing Executable file paths. Add the path for awk.exe
+ to this list, and your system PATH environment variable,
+ as needed.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 that
+ building InstallBin will fail. A workaround is to delete awk.exe from
+ the cygwin installation and rename gawk.exe to awk.exe.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 with SSL support.) To prepare OpenSSL
+ for both release and debug builds of Apache, and
+ disable the patent protected features in 0.9.6, you might use the following
+ build commands:
+ perl util\mkfiles.pl >MINFO
+ perl util\mk1mf.pl dll no-asm no-mdc2 no-rc5 no-idea VC-WIN32 >makefile
+ 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
+ nmake -f makefile.dbg
+ mod_deflate)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.gzip.org/zlib/ -- mod_deflate is
+ confirmed to build correctly with version 1.1.4.Command-Line Build
+
+
+
+ cd to that
+ directory.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
+
Developer Studio Workspace IDE Build
+
+
+
+ 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.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..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.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 explicitly,
+ only if the srclib directories openssl
+ and/or zlib exist..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 (.net) users also benefit, nmake builds
+ are faster than binenv builds.
+ Build the entire project from within the VC++ 5.0 or 6.0 IDE,
+ then use the Project Menu Export for all makefiles.
+ 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 anywhere:
+ perl srclib\apr\build\fixwin32mak.pl
+ httpd source tree. Every
+ .mak and .dep project file within
+ the current directory and below will be corrected, and the
+ timestamps adjusted to reflect the .dsp.Project Components
+
+
+
+ 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\xml\expat\lib\xml.dspsrclib\apr-util\aprutil.dspsrclib\apr-util\libaprutil.dspsrclib\pcre\dftables.dspsrclib\pcre\pcre.dspsrclib\pcre\pcreposix.dspserver\gen_test_char.dsplibhttpd.dspApache.dspmodules\ subdirectory tree contains
+ project files for the majority of the modules.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.dspsupport\htdigest.dspsupport\htpasswd.dspsupport\logresolve.dspsupport\rotatelogs.dspsupport\win32\ApacheMonitor.dspsupport\win32\wintty.dsp\Apache2 directory, of the same drive.nmake commands:
+nmake /f Makefile.win installr INSTDIR=dir
+
+nmake /f Makefile.win installd INSTDIR=dir
+
INSTDIR gives
+ the installation directory; it can be omitted if Apache is
+ to be installed into \Apache2.
+
+
+ dir\bin\Apache.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 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 filesWarning about building Apache from the development tree
+
+
+
+ .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..mak files, always review
+ the generated .mak (or .dep) dependencies for
+ Platform SDK or other garbage 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 include 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.
+
+
+ PATH,
+ INCLUDE, LIB and other variables
+ that can be configured with the vcvars32 batch file:setenv batch file: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.awk.exe from the Tools menu Options... Directories
+ tab (the Projects - VC++ Directories pane in Developer Studio 7.0)
+ listing Executable file paths. Add the path for awk.exe
+ to this list, and your system PATH environment variable,
+ as needed.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 that
+ building InstallBin will fail. A workaround is to delete awk.exe from
+ the cygwin installation and rename gawk.exe to awk.exe.ab.exe with ssl support)srclib subdirectory named
+ openssl, obtained from http://www.openssl.org/source/, in order to compile ab.exe with SSL support.) To prepare OpenSSL
+ for both release and debug builds of Apache, and
+ disable the patent protected features in 0.9.6, you might use the following
+ build commands:
+ perl util\mk1mf.pl dll no-asm no-mdc2 no-rc5 no-idea VC-WIN32 >makefile
+ 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
+ nmake -f makefile.dbg
+ srclib subdirectory named
+ zlib, however those sources need not be compiled. The build system
+ will compile the compression sources directly into the cd to that
+ directory.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
+
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.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..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.Debug
+ and Release Solution modules abs, nmake or the IDE directly
+ with the BinBuild target to build those modules explicitly,
+ only if the srclib directories openssl
+ and/or zlib exist..mak files pose a greater hassle, but they are
+ required for Visual C++ 5.0 users to build nmake builds
+ are faster than binenv builds.
+ Build the entire project from within the VC++ 5.0 or 6.0 IDE,
+ then use the Project Menu Export for all makefiles.
+ 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 anywhere:httpd source tree. Every
+ .mak and .dep project file within
+ the current directory and below will be corrected, and the
+ timestamps adjusted to reflect the .dsp.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\xml\expat\lib\xml.dspsrclib\apr-util\aprutil.dspsrclib\apr-util\libaprutil.dspsrclib\pcre\dftables.dspsrclib\pcre\pcre.dspsrclib\pcre\pcreposix.dspserver\gen_test_char.dsplibhttpd.dspApache.dspmodules\ subdirectory tree contains
+ project files for the majority of the modules.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.dspsupport\htdigest.dspsupport\htpasswd.dspsupport\logresolve.dspsupport\rotatelogs.dspsupport\win32\ApacheMonitor.dspsupport\win32\wintty.dsp\Apache2 directory, of the same drive.nmake commands:
+nmake /f Makefile.win installr INSTDIR=dir
+
+nmake /f Makefile.win installd INSTDIR=dir
+
INSTDIR gives
+ the installation directory; it can be omitted if Apache is
+ to be installed into \Apache2.
+
+
+ dir\bin\Apache.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 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..mak files, always review
+ the generated .mak (or .dep) dependencies for
+ Platform SDK or other garbage 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 include 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.
Running Apache for Windows as a Service
+
+ httpd.conf file should always be
+ followed by starting Apache as a console window. If this
+ succeeds, the service should succeed.-u) and re-installing
+ (-i) the Apache service.
+ NET START APACHE
+ NET STOP APACHE
+ Note
+ Apache, unlike many other Windows NT/2000 services,
+ logs any errors to its own error.log file in the logs folder
+ within the Apache server root folder. You will not
+ find Apache error details in the Windows NT Event
+ Log.
+ apache -n "service name"
+
Running Apache for Windows as a Service
Important Note on service dependencies:
User Account for Apache Service to Run As (NT/2000)
Troubleshooting Apache for Windows as a Service
Running Apache for Windows from the Command Line
Controlling Apache as a Service
HIGHLY EXPERIMENTAL Windows 95/98 ServiceRunning Apache for Windows as a Service
+
+
+
+ -n option to specify a service
+ name is only available with Apache 1.3.7 and later.
+ Earlier versions of Apache only support the default service name
+ "Apache".
+ apache -i -n "service name"
+
+ apache -i -n "service name" -f "\my server\conf\my.conf"
+
+ apache -u -n "service name"
+ -n
+ option, in conjunction with other options, to refer to a
+ service's configuration file. For example:
+ apache -n "service name" -t
+
+ apache -n "service name"
+ Important Note on service dependencies:
+
+
+
+
+ Run regedt32
+ Select Window - "HKEY_LOCAL_MACHINE on Local Machine" from the menu
+ Double-click to open the SYSTEM, then the CurrentControlSet keys
+ Scroll down and click on the Apache servicename
+ Select Edit - Add Value... from the menu
+ Fill in the Add Value dialog with
+ Value Name: DependOnGroup
+ Data Type: REG_MULTI_SZ
+ and click OK
+ Leave the Multi-String Editor dialog empty and click OK
+ Select Edit - Add Value... from the menu
+ Fill in the Add Value dialog with
+ Value Name: DependOnService
+ Data Type: REG_MULTI_SZ
+ and click OK
+ Type the following list (one per line) in the Multi-String Editor dialog
+ Tcpip
+ Afd
+ and click OK
+ User Account for Apache Service to Run As (NT/2000)
+
+
+
+ -i option) it will run as user "System" (the LocalSystem
+ account). There should be few issues if all resources for the
+ web server reside on the local system, but it has broad
+ security privileges to affect the local machine!
+
+
+
+
+ document and script
+ directories (minimally read and browse access).logs directory!Troubleshooting Apache for Windows as a Service
+
+
+
+
+ Could not start the apache service on \\COMPUTER
+ Error 1067; The process terminated unexpectedly.
+ Running Apache for Windows from the Command Line
+
+
+
+ Controlling Apache as a Service
+
+
+
+
+ apache -n "service name" -k start
+ apache -n "service name" -k restart
+ apache -n "service name" -k shutdown
+ apache -n "service name" -k stop
+ -n Apache
+ option is still required, since the -k commands without
+ the -n option are directed at Apache running in a console
+ window. The quotes are only required if the service name contains spaces.-k stop alias for the
+ -k shutdown command was introduced in Apache version
+ 1.3.13. Earlier versions of Apache will only recognize the
+ -k shutdown option. Prior to 1.3.3, Apache did not
+ recognize any -k options at all!NET command
+ to start and stop Apache services as follows:
+ NET START "service name"
+ NET STOP "service name"
+ HIGHLY EXPERIMENTAL Windows 95/98 Service
+
+
+
+
+ Apache -n "service name" -k start
+ httpd.conf file,
+ then the console window will remain visible. This will display
+ an error message which will be useful in tracking down the cause
+ of the problem.NET START or
+ NET STOP commands so you must use Apache's Service
+ Control options at a command prompt. You may wish to set up a
+ shortcut for each of these commands so that you can just choose
+ it from the start menu or desktop to perform the required action.Running Apache for Windows as a Service
+ httpd.conf file should always be
+ followed by starting Apache as a console window. If this
+ succeeds, the service should succeed.
NOTE: Prior to version 1.3.13, the configuration was
+
-u) and re-installing
+ (-i) the Apache service.
To start Apache as a service, you first need to install it as a service. Multiple Apache services can be installed, each @@ -50,103 +43,118 @@ You can later stop Apache by clicking on Stop. As an alternative to using the Services window, you can start and stop the "Apache" service from the command line with
-- NET START APACHE - NET STOP APACHE -+ +
See Controlling Apache as a Service for more information on installing and controlling Apache services.
-Apache, unlike many other Windows NT/2000 services,
+
After starting Apache as a service (or if you have trouble starting it) you can test it using the same procedure as for running in a console window. Remember to use the command:
-- apache -n "service name" -+ +
to assure you are using the service's configuration.
-Note: The -n option to specify a service name is - only available with Apache 1.3.7 and later. Earlier - versions of Apache only support the default service name - 'Apache'.
+-n option to specify a service
+ name is only available with Apache 1.3.7 and later.
+ Earlier versions of Apache only support the default service name
+ "Apache".You can install Apache as a Windows NT service as follows:
-- apache -i -n "service name" -+ +
To install a service to use a particular configuration, specify the configuration file when the service is installed:
-- apache -i -n "service name" -f "\my server\conf\my.conf" -+ +
To remove an Apache service, use:
-- apache -u -n "service name" -+ +
The default "service name", if one is not specified, is "Apache".
-Once a service is installed, you can use the -n +
Once a service is installed, you can use the -n
option, in conjunction with other options, to refer to a
service's configuration file. For example:
To test a service's configuration file:
-- apache -n "service name" -t -+ +
To start a console Apache using a service's configuration file:
-- apache -n "service name" --
Prior to Apache release 1.3.13, the dependencies required to successfully start an installed service were not configured. After installing a service using earlier versions of Apache, you must follow these steps:
-- Run regedt32 - Select Window - "HKEY_LOCAL_MACHINE on Local Machine" from the menu - Double-click to open the SYSTEM, then the CurrentControlSet keys - Scroll down and click on the Apache servicename - Select Edit - Add Value... from the menu - Fill in the Add Value dialog with - Value Name: DependOnGroup - Data Type: REG_MULTI_SZ - and click OK - Leave the Multi-String Editor dialog empty and click OK - Select Edit - Add Value... from the menu - Fill in the Add Value dialog with - Value Name: DependOnService - Data Type: REG_MULTI_SZ - and click OK - Type the following list (one per line) in the Multi-String Editor dialog - Tcpip - Afd - and click OK -+ +
If you are using COM or DCOM components from a third party module, ISAPI, or other add-in scripting technologies such as @@ -157,36 +165,36 @@ DependOnService value, double click that value if it already exists, and add the Rpcss entry to the list.
-When Apache is first installed as a service (e.g. with the
- -i option) it will run as user "System" (the LocalSystem
+ -i option) it will run as user "System" (the LocalSystem
account). There should be few issues if all resources for the
web server reside on the local system, but it has broad
security privileges to affect the local machine!
- LocalSystem is a very privileged account locally, so you - shouldn't run any shareware applications there. However, it - has no network privileges and cannot leave the machine via - any NT-secured mechanism, including file system, named pipes, - DCOM, or secure RPC. -+
NEVER grant network privileges to the SYSTEM account! Create a new user account instead, grant the - appropriate privileges to that user, and use the the 'Log On - As:' option. Select the Start Menu -> Settings -> Control + appropriate privileges to that user, and use the the "Log On + As:" option. Select the Start Menu -> Settings -> Control Panel -> Services -> apache service ... and click the "Startup" button to access this setting.
-- A service that runs in the context of the LocalSystem account - inherits the security context of the SCM. It is not - associated with any logged-on user account and does not have - credentials (domain name, user name, and password) to be used - for verification. -+
The SYSTEM account has no privileges to the network, so shared pages or a shared installation of Apache is invisible to @@ -211,7 +219,7 @@
document and script
+ directories (minimally read and browse access).logs directory!If you allow the account to log in as a user, then you can @@ -242,21 +250,25 @@ followed the steps above, Apache should execute as a service with no problems.
-Note: error code 2186 is a good indication - that you need to review the 'Log On As' configuration, since - the server can't access a required network resource.
+When starting Apache as a service you may encounter an error message from Windows service manager. For example if you try to start Apache using the Services applet in Windows Control Panel - you may get the following message;
-- Could not start the apache service on \\COMPUTER - Error 1067; The process terminated unexpectedly. -+ you may get the following message: + +
You will get this error if there is any problem starting Apache. In order to see what is causing the problem you should @@ -266,60 +278,72 @@
Also, Apache 1.3.13 now records startup errors in the Application Event Log under Windows NT/2000, if Apache is run - as a service. Run the Event Viewer and select Log ... - Application to see these events.
+ as a service. Run the Event Viewer and select Log ... + Application to see these events. -Check the Application Event Log with the Event
+
For details on controlling Apache service from the command line, please refer to console - command line section. + command line section.
-Multiple instances of Apache can be installed and run as services. Signal an installed Apache service to start, restart, or shutdown/stop as follows:
-- apache -n "service name" -k start - apache -n "service name" -k restart - apache -n "service name" -k shutdown - apache -n "service name" -k stop -- -
For the default "Apache" service, the -n Apache option is - still required, since the -k commands without the -n option are - directed at Apache running in a console window. The quotes are - only required if the service name contains spaces.
- -Note: the -k stop alias for the -k shutdown command - was introduced in Apache version 1.3.13. Earlier - versions of Apache will only recognize the -k shutdown option. - Prior to 1.3.3, Apache did not recognize any -k - options at all!
- -In addition, you can use the native NT NET command to start - and stop Apache services as follows:
-- NET START "service name" - NET STOP "service name" -+ +
For the default "Apache" service, the -n Apache
+ option is still required, since the -k commands without
+ the -n option are directed at Apache running in a console
+ window. The quotes are only required if the service name contains spaces.
-k stop alias for the
+ -k shutdown command was introduced in Apache version
+ 1.3.13. Earlier versions of Apache will only recognize the
+ -k shutdown option. Prior to 1.3.3, Apache did not
+ recognize any -k options at all!In addition, you can use the native NT NET command
+ to start and stop Apache services as follows:
Again, quotes are only required if the service name contains spaces.
-Note: The service options for Windows 95 and 98 are
+
There is some support for Apache on Windows 95/98 to behave in a similar manner as a service on Windows NT/2000. It is @@ -337,23 +361,24 @@
Apache will attempt to start and if successful it will run in the background. If you run the command
-- Apache -n "service name" -k start -+ +
via a shortcut on your desktop, for example, then if the service starts successfully a console window will flash up but immediately disappears. If Apache detects any errors on startup - such as a incorrect entries in the httpd.conf file, then the - console window will remain visible. This will display an error - message which will be useful in tracking down the cause of the - problem.
+ such as a incorrect entries in thehttpd.conf file,
+ then 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 95/98 does not support NET START or NET STOP - commands so you must use Apache's Service Control options at a - command prompt. You may wish to set up a shortcut for each of - these commands so that you can just choose it from the start - menu or desktop to perform the required action.
+Windows 95/98 does not support NET START or
+ NET STOP commands so you must use Apache's Service
+ Control options at a command prompt. You may wish to set up a
+ shortcut for each of these commands so that you can just choose
+ it from the start menu or desktop to perform the required action.
Apache and Windows 95/98 offer no support for running the Apache service as a specific user with network privileges. In @@ -363,7 +388,8 @@ httpd server. These facilities exist only to assist the user in developing web content and learning the Apache server, and perhaps as a intranet server on a secured, private network.
- - - + +Apache HTTP Server Version 2.0

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.
+ +Most of this document assumes that you are installing + Windows from a binary distribution. If you want to compile + Apache yourself (possibly to help with development, or to track + down bugs), see Compiling Apache + for Microsoft Windows.
+ +At this time, support for Windows 95, 98 and ME is + incomplete. Apache 2.0 is not expected to work on those + platforms at this time. If you are interested in + helping with that effort, please see the developer's site for + information on how to get + involved. Support will likely be provided at some point in + the future, and patches to allow Apache to work on 95, 98 and + ME are welcome!
+ +Apache 2.0 is designed to run on Windows NT 4.0 and Windows + 2000. The binary installer will only work with the x86 family + of processors, such as Intel's. Apache may also run on Windows + 95, 98 and ME, but these are not tested, and are never + recommended for production servers. In all cases TCP/IP + networking must be installed.
+ +If running on Windows 95, the "Winsock2" upgrade MUST BE + INSTALLED. "Winsock2" for Windows 95 is available here.
+ +If running on NT 4.0, installing Service Pack 3 or 6 is + recommended, as Service Pack 4 created known issues with TCP/IP + and WinSock integrity that were resolved in later Service + Packs.
+ +Information on the latest version of Apache can be found on + the Apache web server at http://httpd.apache.org/. + This will list the current release, any more recent alpha or + beta-test releases, together with details of mirror web and + anonymous ftp sites.
+ +You should download the version of Apache for Windows with
+ the .msi extension. This is a single Microsoft
+ Installer file containing Apache, ready to install and run.
+ There is a seperate .zip file containing only
+ the source code, to compile Apache yourself with the Microsoft
+ Visual C++ (Visual Studio) tools.
Run the Apache .msi file you downloaded above.
+ This will ask for:
\Program Files\Apache Group\Apache although you
+ can change this to any other directory)During the installation, Apache will configure the files in
+ the conf directory for your chosen installation
+ directory. However if any of the files in this directory
+ already exist they will not be overwritten.
+ Instead the new copy of the corresponding file will be left
+ with the extension .default. So, for example, if
+ conf\httpd.conf already exists it will not be
+ altered, but the version which would have been installed will
+ be left in conf\httpd.conf.default. After the
+ installation has finished you should manually check to see what is
+ in new in the .default file, and if necessary
+ update your existing configuration files.
Also, if you already have a file called
+ htdocs\index.html then it will not be overwritten
+ (no index.html.default file will be installed
+ either). This should mean it a safe to install Apache over an
+ existing installation (but you will have to stop the existing
+ server running before doing the installation, then start the
+ new one after the installation is finished).
After installing Apache, you should edit the configuration
+ files in the conf directory as required. These
+ files will be configured during the install ready for Apache to
+ be run from the directory where it was installed, with the
+ documents served from the subdirectory htdocs.
+ There are lots of other options which should be set before you
+ start really using Apache. However to get started quickly the
+ files should work as installed.
There are two ways you can run Apache:
+ +As a "service" + (available on Windows NT/2000, or a pseudo-service on Windows + 95, 98 or ME). This is the best option if you want Apache to + automatically start when you machine boots, and to keep + Apache running when you log-off.
From a console window. This MUST + be used by any administrator to test before to attempting to + run as a service.
To run Apache from a console window, select the "Start + Apache as console app" option from the Start menu (in Apache + 1.3.4 and earlier, this option was called "Apache Server"). + This will open a console window and start Apache running inside + it. The window will remain active until you stop Apache. To + stop Apache running, either select the "Shutdown Apache console + app" icon option from the Start menu (this is not available in + Apache 1.3.4 or earlier), or see Signalling + Console Apache when Running for how to control Apache from + the command line.
+ +If the Apache console window closes immediately (or
+ unexpectedly), run the "Command Prompt" from the Start Menu -
+ Programs list. Change to the folder to which you installed
+ Apache, type the command apache, and read the error message.
+ Then change to the logs folder, and review the
+ error.log file for configuration mistakes.
+ If you accepted the defaults when you installed Apache,
+ the commands would be:
+ c:
+ cd "\program files\apache group\apache"
+ apache
+ Wait for Apache to exit, or press Ctrl+C
+ cd logs
+ more <error.log
+
Complete the steps above before you proceed + to attempt to start Apache as a Window NT/2000 + service!
+ +To start Apache as a service, you first need to install it + as a service. Multiple Apache services can be installed, each + with a different name and configuration. To install the default + Apache service named "Apache", run the "Install Apache as + Service (NT only)" option from the Start menu. Once this is + done you can start the "Apache" service by opening the Services + window (in the Control Panel), selecting Apache, then clicking + on Start. Apache will now be running in the background. You can + later stop Apache by clicking on Stop. As an alternative to + using the Services window, you can start and stop the "Apache" + service from the control line with:
+ +
+ NET START APACHE
+ NET STOP APACHE
+
See Signalling Service Apache when + Running for more information on installing and controlling + Apache services.
+ +error.log file in the
+ logs folder within the Apache server root folder.
+ You will not find Apache error details in the Windows
+ NT Event Log.After starting Apache running (either in a console window or
+ as a service) it will be listening to port 80 (unless you
+ changed the Listen directive in the configuration
+ files). To connect to the server and access the default page,
+ launch a browser and enter this URL:
+ http://localhost/
+
This should respond with a welcome page, and a link to the
+ Apache manual. If nothing happens or you get an error, look in
+ the error_log file in the logs
+ directory. If your host isn't connected to the net, you may
+ have to use this URL:
+ http://127.0.0.1/
+
Once your basic installation is working, you should
+ configure it properly by editing the files in the
+ conf directory. Again, if you change the
+ configuration of the Windows NT/2000 service for Apache, first
+ attempt to start it from the command line to assure that the
+ service starts with no errors.
Because Apache CANNOT share the same port with + another TCPIP application, you may need to stop or uninstall + certain services first. These include (but are not limited to) + other web servers, and firewall products such as BlackIce. If + you can only start Apache with these services disabled, + reconfigure either Apache or the other product so that they do + not listen on the same TCPIP ports.
+ +Apache is configured by files in the conf
+ directory. These are the same as files used to configure the
+ Unix version, but there are a few different directives for
+ Apache on Windows. See the Apache
+ documentation for all the available directives.
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 + with Unix. Instead there are usually only two Apache + processes running: a parent process, and a child which + handles the requests. Within the child each request is + handled by a separate thread.
+ +So the "process"-management directives are + different:
+ +MaxRequestsPerChild
+ - Like the Unix directive, this controls how many requests
+ a process will serve before exiting. However, unlike Unix,
+ a process serves all the requests at once, not just one, so
+ if this is set, it is recommended that a very high number
+ is used. The recommended default, MaxRequestsPerChild
+ 0, does not cause the process to ever exit.
httpd.conf, the new child may not
+ start or you may receive unexpected results.ThreadsPerChild
+ - This directive is new, and tells the server how many
+ threads it should use. This is the maximum number of
+ connections the server can handle at once; be sure and set
+ this number high enough for your site if you get a lot of
+ hits. The recommended default is ThreadsPerChild
+ 50.
The directives that accept filenames as arguments now + 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.
+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 \Apache\modules directory. To
+ activate these, or other modules, the new LoadModule
+ directive must be used. For example, to active the status
+ module, use the following (in addition to the
+ status-activating directives in
+ access.conf):
+ LoadModule status_module modules/mod_status.so
+
Information on creating loadable + modules is also available.
+Apache can also load ISAPI Extensions (i.e., + Internet Server Applications), such as those used by + Microsoft's 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
+ ScriptInterpreterSource
+ directive.
Since it is often difficult to manage files with names
+ like .htaccess under windows, you may find it
+ useful to change the name of this configuration file using
+ the AccessFilename
+ directive.
-n option to specify a service name
+ is only available with Apache 1.3.7 and later. Earlier versions of
+ Apache only support the default service name
+ "Apache".You can install Apache as a Windows NT service as + follows:
+ +
+ apache -k install -n "service name"
+
To install a service to use a particular configuration, + specify the configuration file when the service is + installed:
+ +
+ apache -k install -n "service name" -f "\my server\conf\my.conf"
+
To remove an Apache service, use
+ +
+ apache -k uninstall -n "service name"
+
The default "service name", if one is not specified, is + "Apache".
+ +Once a service is installed, you can use the -n
+ option, in conjunction with other options, to refer to a
+ service's configuration file. For example:
To test a service's configuration file:
+ +
+ apache -n "service name" -t
+
To start a console Apache using a service's configuration + file:
+ +
+ apache -n "service name"
+
Important Note on service dependencies:
+ +Prior to Apache release 1.3.13, the dependencies required to + successfully start an installed service were not configured. + After installing a service using earlier versions of Apache, + you must follow these steps:
+ +
+ Run regedt32
+ Select Window - "HKEY_LOCAL_MACHINE on Local Machine" from the menu
+ Double-click to open the SYSTEM, then the CurrentControlSet keys
+ Scroll down and click on the Apache servicename
+ Select Edit - Add Value... from the menu
+ Fill in the Add Value dialog with
+ Value Name: DependOnGroup
+ Data Type: REG_MULTI_SZ
+ and click OK
+ Leave the Multi-String Editor dialog empty and click OK
+ Select Edit - Add Value... from the menu
+ Fill in the Add Value dialog with
+ Value Name: DependOnService
+ Data Type: REG_MULTI_SZ
+ and click OK
+ Type the following list (one per line) in the Multi-String Editor dialog
+ Tcpip
+ Afd
+ and click OK
+
If you are using COM or DCOM components from a third party + module, ISAPI, or other add-in scripting technologies such as + ActiveState Perl, you may also need to add the entry Rpcss to + the DependOnService list. To avoid exposing the TCP port 135 + when it is unnecessary, Apache does not create that entry upon + installation. Follow the directions above to find or create the + DependOnService value, double click that value if it already + exists, and add the Rpcss entry to the list.
+ +The Start menu icons and the NT Service manager can provide + a simple interface for administering Apache. But in some cases + it is easier to work from the command line.
+ +When working with Apache it is important to know how it will + find the configuration files. You can specify a configuration + file on the command line in two ways:
+ +-f specifies a path to a particular
+ configuration file
+ apache -f "c:\my server\conf\my.conf"
+ apache -f test\test.conf
+
-n specifies the configuration file of
+ an installed Apache service (Apache 1.3.7 and later)
+ apache -n "service name"
+
In these cases, the proper ServerRoot should be set in the configuration file.
If you don't specify a configuration file name with -f or
+ -n, Apache will use the file name compiled into the server,
+ usually "conf/httpd.conf". Invoking Apache with the
+ -V switch will display this value labeled as
+ SERVER_CONFIG_FILE. Apache
+ will then determine its ServerRoot by trying the following, in
+ this order:
ServerRoot directive via a
+ -C switch.-d switch on the command line.The server root compiled into the server is usually
+ "/apache". invoking apache with the -V switch
+ will display this value labeled as HTTPD_ROOT.
When invoked from the start menu, Apache is usually passed + no arguments, so using the registry entry is the preferred + technique for console Apache.
+ +During a binary installation, a version-specific registry + key is created in the Windows registry:
+ +
+ HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\1.3.7
+
+ HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\2.0a3
+
This key is compiled into the server and can enable you to + test new versions without affecting the current version. Of + course you must take care not to install the new version on top + of the old version in the file system.
+ +If you did not do a binary install then Apache will in some + scenarios complain that about the missing registry key. This + warning can be ignored if it otherwise was able to find its + configuration files.
+ +The value of this key is the ServerRoot directory, containing the conf
+ directory. When Apache starts it will read the httpd.conf
+ file from this directory. If this file contains a
+ ServerRoot directive which
+ is different from the directory obtained from the registry key above,
+ Apache will forget the registry key and use the directory from the
+ configuration file. If you copy the Apache directory or configuration
+ files to a new location it is vital that you update the
+ ServerRoot directory
+ in the httpd.conf file to the new location.
To run Apache from the command line as a console + application, use the following command:
+ +
+ apache
+
Apache will execute, and will remain running until it is + stopped by pressing control-C.
+ +On Windows NT, multiple instances of Apache can be run as + services. Signal an Apache service to start, restart, or + shutdown as follows:
+ +
+ apache -n "service name" -k start
+ apache -n "service name" -k restart
+ apache -n "service name" -k shutdown
+
In addition, you can use the native NT NET command
+ to start and stop Apache services as follows:
+ NET START "service name"
+ NET STOP "service name"
+
On Windows 95, Apache runs as a console application. You can + tell a running Apache to stop by opening another console window + and typing:
+ +
+ apache -k shutdown
+
This should be used instead of pressing Control-C in the + running Apache console window, because it lets Apache end any + current transactions and cleanup gracefully.
+ +You can also tell Apache to restart. This makes it re-read + the configuration files. Any transactions in progress are + allowed to complete without interruption. To restart Apache, + run
+ +
+ apache -k restart
+
kill -TERM
+ pid and kill -USR1 pid.
+ The command line option used, -k, was chosen as a
+ reminder of the "kill" command used on Unix.This document explains how to install, configure and run Apache 2.0 under Microsoft Windows. If you find any bugs, or @@ -34,35 +28,12 @@ involved. Support will likely be provided at some point in the future, and patches to allow Apache to work on 95, 98 and ME are welcome!
-Apache 2.0 is designed to run on Windows NT 4.0 and Windows 2000. The binary installer will only work with the x86 family @@ -80,8 +51,11 @@ and WinSock integrity that were resolved in later Service Packs.
-Information on the latest version of Apache can be found on
the Apache web server at You should download the version of Apache for Windows with
the .msi extension. This is a single Microsoft
Installer file containing Apache, ready to install and run.
- There is a seperate .zip file containing _only_
+ There is a seperate .zip file containing only
the source code, to compile Apache yourself with the Microsoft
Visual C++ (Visual Studio) tools.
Run the Apache .msi file you downloaded above. +
Run the Apache .msi file you downloaded above.
This will ask for:
During the installation, Apache will configure the files in
- the conf directory for your chosen installation
+ the conf directory for your chosen installation
directory. However if any of the files in this directory
- already exist they will not be overwritten.
+ already exist they will not be overwritten.
Instead the new copy of the corresponding file will be left
- with the extension .default. So, for example, if
- conf\httpd.conf already exists it will not be
+ with the extension .default. So, for example, if
+ conf\httpd.conf already exists it will not be
altered, but the version which would have been installed will
- be left in conf\httpd.conf.default. After the
+ be left in conf\httpd.conf.default. After the
installation has finished you should manually check to see what is
- in new in the .default file, and if necessary
+ in new in the .default file, and if necessary
update your existing configuration files.
Also, if you already have a file called
- htdocs\index.html then it will not be overwritten
- (no index.html.default file will be installed
+ htdocs\index.html then it will not be overwritten
+ (no index.html.default file will be installed
either). This should mean it a safe to install Apache over an
existing installation (but you will have to stop the existing
server running before doing the installation, then start the
new one after the installation is finished).
After installing Apache, you should edit the configuration
- files in the conf directory as required. These
+ files in the conf directory as required. These
files will be configured during the install ready for Apache to
be run from the directory where it was installed, with the
- documents served from the subdirectory htdocs.
+ documents served from the subdirectory htdocs.
There are lots of other options which should be set before you
start really using Apache. However to get started quickly the
files should work as installed.
There are two ways you can run Apache:
As a "service" (available on Windows NT/2000, or a pseudo-service on Windows 95, 98 or ME). This is the best option if you want Apache to automatically start when you machine boots, and to keep - Apache running when you log-off.
From a console window. This MUST be used by any administrator to test before to attempting to - run as a service.
To run Apache from a console window, select the "Start @@ -176,20 +158,22 @@ unexpectedly), run the "Command Prompt" from the Start Menu - Programs list. Change to the folder to which you installed Apache, type the command apache, and read the error message. - Then change to the logs folder, and review the error.log file - for configuration mistakes. If you accepted the defaults when - you installed Apache, the commands would be:
-- c: - cd "\program files\apache group\apache" - apache - Wait for Apache to exit, or press Ctrl+C - cd logs - more <error.log -- -
Complete the steps above before you proceed to
- attempt to start Apache as a Window NT/2000
+ Then change to the logs folder, and review the
+ error.log file for configuration mistakes.
+ If you accepted the defaults when you installed Apache,
+ the commands would be:
Complete the steps above before you proceed + to attempt to start Apache as a Window NT/2000 service!
To start Apache as a service, you first need to install it @@ -203,42 +187,45 @@ later stop Apache by clicking on Stop. As an alternative to using the Services window, you can start and stop the "Apache" service from the control line with:
-- NET START APACHE - NET STOP APACHE -+ +
See Signalling Service Apache when Running for more information on installing and controlling Apache services.
-Apache, unlike many other Windows NT/2000 services, - logs any errors to its own error.log file in the logs folder - within the Apache server root folder. You will not - find Apache error details in the Windows NT Event - Log.
+error.log file in the
+ logs folder within the Apache server root folder.
+ You will not find Apache error details in the Windows
+ NT Event Log.After starting Apache running (either in a console window or
as a service) it will be listening to port 80 (unless you
- changed the Listen directive in the configuration
+ changed the
- http://localhost/ -+ +
This should respond with a welcome page, and a link to the
Apache manual. If nothing happens or you get an error, look in
- the error_log file in the logs
+ the error_log file in the logs
directory. If your host isn't connected to the net, you may
have to use this URL:
- http://127.0.0.1/ -+ +
Once your basic installation is working, you should
configure it properly by editing the files in the
- conf directory. Again, if you change the
+ conf directory. Again, if you change the
configuration of the Windows NT/2000 service for Apache, first
attempt to start it from the command line to assure that the
service starts with no errors.
Apache is configured by files in the conf +
Apache is configured by files in the So the "process"-management directives are
different: ThreadsPerChild
+ 0, does not cause the process to ever exit. Information on creating loadable
@@ -335,62 +325,73 @@
Filters. When running CGI scripts, the method Apache uses to find
+ the interpreter for the script is configurable using the
+ Since it is often difficult to manage files with names
+ like conf
directory. These are the same as files used to configure the
Unix version, but there are a few different directives for
Apache on Windows. See the Apache
@@ -274,21 +264,20 @@
MaxRequestsPerChild
- 0, does not cause the process to ever exit.
- Warning: The server configuration file is reread
- when the new child process is started. If you have modified
- httpd.conf, the new child may not start or you may receive
- unexpected results.httpd.conf, the new child may not
+ start or you may receive unexpected results.\Apache\modules directory. To
- activate these, or other modules, the new LoadModule
+ activate these, or other modules, the new access.conf):
- LoadModule status_module modules/mod_status.so
-
+
+ .htaccess under windows, you may find it
- useful to change the name of this configuration file using
- the AccessFilename
- directive..htaccess under windows, you may find it
+ useful to change the name of this configuration file using
+ the Running Apache for Windows
- as a Service
+
Note: The -n option to specify a service name is
- only available with Apache 1.3.7 and later. Earlier versions of
+ -n option to specify a service name
+ is only available with Apache 1.3.7 and later. Earlier versions of
Apache only support the default service name
- 'Apache'.
You can install Apache as a Windows NT service as follows:
-- apache -k install -n "service name" -+ +
To install a service to use a particular configuration, specify the configuration file when the service is installed:
-- apache -k install -n "service name" -f "\my server\conf\my.conf" -+ +
To remove an Apache service, use
-- apache -k uninstall -n "service name" -+ +
The default "service name", if one is not specified, is "Apache".
-Once a service is installed, you can use the -n +
Once a service is installed, you can use the -n
option, in conjunction with other options, to refer to a
service's configuration file. For example:
To test a service's configuration file:
-- apache -n "service name" -t -+ +
To start a console Apache using a service's configuration file:
-- apache -n "service name" -+ +
Important Note on service dependencies:
@@ -398,27 +399,28 @@ successfully start an installed service were not configured. After installing a service using earlier versions of Apache, you must follow these steps: -- Run regedt32 - Select Window - "HKEY_LOCAL_MACHINE on Local Machine" from the menu - Double-click to open the SYSTEM, then the CurrentControlSet keys - Scroll down and click on the Apache servicename - Select Edit - Add Value... from the menu - Fill in the Add Value dialog with - Value Name: DependOnGroup - Data Type: REG_MULTI_SZ - and click OK - Leave the Multi-String Editor dialog empty and click OK - Select Edit - Add Value... from the menu - Fill in the Add Value dialog with - Value Name: DependOnService - Data Type: REG_MULTI_SZ - and click OK - Type the following list (one per line) in the Multi-String Editor dialog - Tcpip - Afd - and click OK -+ +
If you are using COM or DCOM components from a third party module, ISAPI, or other add-in scripting technologies such as @@ -429,8 +431,11 @@ DependOnService value, double click that value if it already exists, and add the Rpcss entry to the list.
-The Start menu icons and the NT Service manager can provide a simple interface for administering Apache. But in some cases @@ -441,36 +446,41 @@ file on the command line in two ways:
-f specifies a path to a particular
+ configuration file- apache -f "c:\my server\conf\my.conf" - apache -f test\test.conf -+ +
-n specifies the configuration file of
+ an installed Apache service (Apache 1.3.7 and later)- apache -n "service name" -- -
In these cases, the proper ServerRoot should be set in the - configuration file.
- -If you don't specify a configuration file name with -f or
- -n, Apache will use the file name compiled into the server,
- usually "conf/httpd.conf". Invoking Apache with the -V switch
- will display this value labeled as SERVER_CONFIG_FILE. Apache
- will then determine its ServerRoot by trying the following, in
+
+
In these cases, the proper
If you don't specify a configuration file name with -f or
+ -n, Apache will use the file name compiled into the server,
+ usually "conf/httpd.conf". Invoking Apache with the
+ -V switch will display this value labeled as
+ SERVER_CONFIG_FILE. Apache
+ will then determine its
ServerRoot directive via a
+ -C switch.-d switch on the command line.The server root compiled into the server is usually - "/apache". invoking apache with the -V switch will display this - value labeled as HTTPD_ROOT.
+ "/apache". invoking apache with the -V switch
+ will display this value labeled as HTTPD_ROOT.
When invoked from the start menu, Apache is usually passed no arguments, so using the registry entry is the preferred @@ -490,11 +500,12 @@
During a binary installation, a version-specific registry key is created in the Windows registry:
-- HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\1.3.7 - HKEY_LOCAL_MACHINE\Software\Apache Group\Apache\2.0a3 -+
This key is compiled into the server and can enable you to test new versions without affecting the current version. Of @@ -506,54 +517,65 @@ warning can be ignored if it otherwise was able to find its configuration files.
-The value of this key is the "ServerRoot" directory, - containing the conf directory. When Apache starts - it will read the httpd.conf file from this - directory. If this file contains a ServerRoot - directive which is different from the directory obtained from - the registry key above, Apache will forget the registry key and - use the directory from the configuration file. If you copy the - Apache directory or configuration files to a new location it is - vital that you update the ServerRoot directory in - the httpd.conf file to the new location.
+The value of this key is the conf
+ directory. When Apache starts it will read the httpd.conf
+ file from this directory. If this file contains a
+ httpd.conf file to the new location.
To run Apache from the command line as a console application, use the following command:
-- apache -+ +
Apache will execute, and will remain running until it is stopped by pressing control-C.
-On Windows NT, multiple instances of Apache can be run as services. Signal an Apache service to start, restart, or shutdown as follows:
-- apache -n "service name" -k start - apache -n "service name" -k restart - apache -n "service name" -k shutdown -- -
In addition, you can use the native NT NET command to start - and stop Apache services as follows:
-- NET START "service name" - NET STOP "service name" -- -
In addition, you can use the native NT NET command
+ to start and stop Apache services as follows:
On Windows 95, Apache runs as a console application. You can tell a running Apache to stop by opening another console window and typing:
-- apache -k shutdown -+ +
This should be used instead of pressing Control-C in the running Apache console window, because it lets Apache end any @@ -563,16 +585,19 @@ the configuration files. Any transactions in progress are allowed to complete without interruption. To restart Apache, run
-- apache -k restart --
Note for people familiar with the Unix version of Apache:
+ kill -TERM
pid and kill -USR1 pid.
The command line option used, -k, was chosen as a
- reminder of the "kill" command used on Unix.
kill" command used on Unix.
+
+