akosut 97/07/21 14:26:59
Modified: . README.NT htdocs/manual new_features_1_3.html htdocs/manual/mod core.html directives.html index.html src/nt mod_dll.c Added: htdocs/manual windows.html htdocs/manual/mod mod_dll.html Log: Create some docs on Apache for Windows. Note that some of this is tenative, and likely to change soon. Revision Changes Path 1.2 +11 -0 apache/README.NT Index: README.NT =================================================================== RCS file: /export/home/cvs/apache/README.NT,v retrieving revision 1.1 retrieving revision 1.2 diff -c -C3 -r1.1 -r1.2 *** README.NT 1997/06/15 19:22:22 1.1 --- README.NT 1997/07/21 21:26:52 1.2 *************** *** 1,3 **** --- 1,14 ---- + NOTE - About this File + ====================== + + This file contains development information on Apache for Windows, not all + of which is relevant to the current version. For information on + installation and use of Apache for Windows, please see + http://www.apache.org/docs/windows.html, also available as + htdocs/manual/windows.html with this distribution. + + Alexei Kosut <[EMAIL PROTECTED]> - July 21, 1997 + Integration with official Apache sources ======================================== 1.10 +1 -2 apache/htdocs/manual/new_features_1_3.html Index: new_features_1_3.html =================================================================== RCS file: /export/home/cvs/apache/htdocs/manual/new_features_1_3.html,v retrieving revision 1.9 retrieving revision 1.10 diff -c -C3 -r1.9 -r1.10 *** new_features_1_3.html 1997/07/19 08:58:31 1.9 --- new_features_1_3.html 1997/07/21 21:26:53 1.10 *************** *** 30,37 **** <ul> ! <li><b><a href="nt.html">Support for Windows NT/95</a></b> ! [Documentation to be written]<br> Apache now supports the Windows NT and Windows 95 operating systems, as well as the Unix systems supported in previos releases. Although the Windows version of Apache may not be perform as well as on the Unix --- 30,36 ---- <ul> ! <li><b><a href="windows.html">Support for Windows NT/95</a></b><br> Apache now supports the Windows NT and Windows 95 operating systems, as well as the Unix systems supported in previos releases. Although the Windows version of Apache may not be perform as well as on the Unix 1.1 apache/htdocs/manual/windows.html Index: windows.html =================================================================== <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Using Apache with Microsoft Windows</TITLE> </HEAD> <!-- Background white, links blue (unvisited), navy (visited), red (active) --> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#000080" ALINK="#FF0000" > <!--#include virtual="header.html" --> <H1 ALIGN="CENTER">Using Apache With Microsoft Windows</H1> <p>This document explains how to compile, install, configure and run Apache 1.3a1 (or later) under Microsoft Windows. Please note that at this time, Windows support is entirely experimental, and is recommended only for experienced users. The Apache Group does not guarantee that this software will work as documented, or even at all. If you find any bugs, or wish to contribute in other ways, please use our <a href="http://www.apache.org/bug_report.html">bug reporting page.</a></p> <hr> <ul> <li><a href="#req">Requirements</a> <li><a href="#down">Downloading Apache for Windows</a> <li><a href="#comp">Compiling Apache for Windows</a> <li><a href="#inst">Installing Apache for Windows</a> <li><a href="#use">Using Apache for Windows</a> </ul> <hr> <h2><a name="req">Requirements</a></h2> <p>Apache 1.3a1 requires the following:</p> <ul> <li>Microsoft Windows NT 4.0<a href="#351">*</a>, or Windows 95. <li>An Intel-based PC-compatible capable of running above OS (exact requirements unknown) with a connection to a TCP/IP network. <li>Microsoft Visual C++ 5.0 or later. </ul> <p><small><a name="351">*</a> Apache may run with Windows NT 3.5.1, but has not been tested.</small></p> <p>Apache 1.3a1 is available only in source form. Future releases will contain prebuilt binaries for use by those without compilers (which we understand are the vast majority of Windows users), however the current release requires Microsoft Visual C++ 5.0 or later. The Apache Group is releasing 1.3a1 only as source to limit the alpha release to those who have the tools and knowledge to assist with the development processes.</p> <p>This documentation assumes good working knowledge of Microsoft Windows, Microsoft Visual C++, and the Apache web server (for Unix).</p> <H2><a name="down">Downloading Apache for Windows</a></H2> <p>Information on the latest version of Apache can be found on the Apache web server at <A HREF="http://www.apache.org/">http://www.apache.org/</A>. This will list the current release, any more recent alpha or beta-test release, together with details of mirror web and anonymous ftp sites.</p> <p>You will be able to download Apache 1.3a1 or a later release in several forms, including a WinZip (<code>.zip</code>) archive. Although this contains the same files as the others (likely <code>.tar.gz</code> and <code>.tar.Z</code>), it is recommended for Windows use, as all the files contained therein will contain Windows line breaks. The other archives may contain files with Unix line breaks, which will not function on Windows (although they may).</p> <h2><a name="comp">Compiling Apache for Windows</a></h2> <p>Compiling Apache requires Microsoft Visual C++ 5.0 to be properly installed. It is easiest to compile with the command-line tools (nmake, etc...). Consult the VC++ manual to determine how to install them.</p> <p>First, unpack the Apache distribution into an appropriate directory. Open a command-line prompt, and change to the <code>src</code> subdirectory of the Apache distribution.</p> <p>The master Apache makefile instructions are contained in the <code>Makefile.nt</code> file. To compile Apache, simply use one of the following commands: <ul> <li><code>nmake /f Makefile.nt release</code> <li><code>nmake /f Makefile.nt debug</code> </ul> <p>These will both compile Apache. The latter will include debugging information in the resulting files, making it easier to find bugs and track down problems.</p> <p>Apache can also be compiled using VC++'s Visual Studio development environment. Although compiling Apache in this manner is not as simple, it makes it possible to easily modify the Apache source, or to compile Apache if the command-line tools are not installed.</p> <p>Project files (<code>.DSP</code>) are included for each of the portions of Apache. The two projects that are necessary for Apache to run are <code>Apache.dsp</code> and <code>ApacheCore.dsp</code>. The <code>src\nt</code> subdirectory also contains project files for the optional modules (see below).</p> <h2><a name="inst">Installing Apache for Windows</a></h2> <p>Once Apache has been compiled, it needs to be installed in its server root directory. The hard-coded default is the <code>\Apache</code> directory, on the current hard drive. Another directory may be used, but the files will need to be installed manually.</p> <p>To install the files into the </code>\Apache</code> directory automatically, use one the following nmake commands (see above):</p> <ul> <li><code>nmake /f Makefile.nt installr</code> (for release build) <li><code>nmake /f Makefile.nt installd</code> (for debug build) </ul> <p>This will install the following:</p> <ul> <li><code>\Apache\Apache.exe</code> - Apache executable <li><code>\Apache\ApacheCore.dll</code> - Main Apache shared library <li><code>\Apache\modules\ApacheModule*.dll</code> - Optional Apache modules (7 files) <li><code>\Apache\conf</code> - Empty configuration directory <li><code>\Apache\logs</code> - Empty logging directory </ul> <p>If you do not have nmake, or wish to install in a different directory, be sure to use a similar naming scheme.</p> <h2><a name="use">Using Apache for Windows</a></h2> <p>The first step is to set up Apache's configuration files. Default configuration files for Windows are located in the <code>conf</code> subdirectory in the Apache distribution, and are named <code>httpd.conf-dist-win</code>, <code>access.conf-dist-win</code> and <code>srm.conf-dist-win</code>. Move these into <code>\Apache\conf</code>, and rename them <code>httpd.conf</code>, <code>access.conf</code> and <code>srm.conf</code>, respectively.</p> <p>Configuring Apache is nearly identical to the Unix version of Apache, so most of the standard <a href="./">Apache documentation</a> is applicable. A few things are, however, different:</p> <ul> <li><p>Because Apache for Windows is multithreaded, it does not use a separate process for each request, as Apache does with Unix. Therefore, the "process"-management directives are different: <p><a href="mod/core.html#startservers">StartServers</a> - This tells the server how many processes to use. Unlike Unix, there will never be more than this number, and only one will be used at a time (the others will be held in reserve in case the main processes crashes or otherwise dies). The recommended default is <code>StartServers 3</code>. <p><a href="mod/core.html#maxrequestsperchild">MaxRequestsPerChild</a> - 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, <code>MaxRequestsPerChild 0</code>, does not cause the process to ever exit. <p><a href="mode/core.html#threadsperchild">ThreadsPerChild</a> - 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 <code>ThreadsPerChild 20</code>.</p> <li><p>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.</p> <li><p>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 <code>\Apache\modules</code> directory. To activate these, or other modules, the new <a href="mod/mod_dll.html#loadmodule">LoadModule</a> directive must be used. For example, to active the status module, use the following (in addition to the status-activating directives in <code>access.conf</code>):</p> <pre> LoadModule status_module modules/ApacheModuleStatus.dll </pre> <p>Information on <a href="mod/mod_dll.html#creating">creating module DLLs</a> is also available.</p> </ul> <p>Once Apache is configured correctly, it is nearly ready to be run. However, we recommend you copy the <code>icons</code> and <code>htdocs</code> subdirectories from the Apache distribution to <code>\Apache</code>. The latter is especially important, as it contains the document root (what the server actually serves). <p>Apache can be executed in one of two ways, directly from the command line, or as a Windows NT service. To run it from the command line, use the following command: <pre> C:\Apache> <b>apache -s</b> </pre> <p>Apache will then execute, and will remain running until it is exited. To use Apache as a Windows NT service, use the following:</p> <pre> C:\Apache> <b>apache -i</b> </pre> <p>Then open the Services control panel, and start the Apache service.</p> <p>If you installed Apache in a server root other than <code>\Apache</code>, you must use the <code>-f</code> command-line option to specify the httpd.conf file, or the <code>-d</code> option to specify the server root.</p> <!--#include virtual="footer.html" --> </BODY> </HTML> 1.67 +24 -0 apache/htdocs/manual/mod/core.html Index: core.html =================================================================== RCS file: /export/home/cvs/apache/htdocs/manual/mod/core.html,v retrieving revision 1.66 retrieving revision 1.67 diff -c -C3 -r1.66 -r1.67 *** core.html 1997/07/12 19:43:09 1.66 --- core.html 1997/07/21 21:26:55 1.67 *************** *** 72,77 **** --- 72,78 ---- <li><A HREF="#serverroot">ServerRoot</A> <li><A HREF="#servertype">ServerType</A> <li><A HREF="#startservers">StartServers</A> + <li><A HREF="#threadsperchild">ThreadsPerChild</a> <li><A HREF="#timeout">TimeOut</A> <li><A HREF="#user">User</A> <li><A HREF="#virtualhost"><VirtualHost></A> *************** *** 1391,1398 **** --- 1392,1422 ---- on startup. As the number of processes is dynamically controlled depending on the load, there is usually little reason to adjust this parameter.<p> + <p>When running with Microsoft Windows, this directive sets the total + number of child processes running. Since the Windows version of Apache + is multithreaded, one processes handles all the requests. The rest are + held in reserve until the main processes dies. + See also <A HREF="#minspareservers">MinSpareServers</A> and <A HREF="#maxspareservers">MaxSpareServers</A>.<p><hr> + + <h2><A name="threadsperchild">ThreadsPerChild</A></h2> + <strong>Syntax:</strong> ThreadsPerChild <em>number</em><br> + <strong>Default:</strong> <code>ThreadsPerChild 50</code><br> + <strong>Context:</strong> server config<br> + <strong>Status:</strong> core (Windows)<br> + <strong>Compatbility:</strong> Available only with Apache 1.3 and later + with Windows + + <p>This directive 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. + + <p>See also <A HREF="#startservers">StartServers</A> and <A + HREF="#maxrequestsperchild">MaxRequestsPerChild</A>.</p> + + <hr> <h2><A name="timeout">TimeOut directive</A></h2> <!--%plaintext <?INDEX {\tt TimeOut} directive> --> 1.27 +5 -2 apache/htdocs/manual/mod/directives.html Index: directives.html =================================================================== RCS file: /export/home/cvs/apache/htdocs/manual/mod/directives.html,v retrieving revision 1.26 retrieving revision 1.27 diff -c -C3 -r1.26 -r1.27 *** directives.html 1997/07/08 19:50:39 1.26 --- directives.html 1997/07/21 21:26:55 1.27 *************** *** 107,114 **** <li><A HREF="core.html#limit"><Limit></A> <li><A HREF="core.html#listen">Listen</A> <li><A HREF="core.html#listenbacklog">ListenBacklog</A> ! <li><A HREF="mod_dld.html#loadfile">LoadFile</A> ! <li><A HREF="mod_dld.html#loadmodule">LoadModule</A> <li><A HREF="core.html#location"><Location></A> <li><A HREF="core.html#locationmatch"><LocationMatch></A> <li><A HREF="core.html#lockfile">LockFile</A> --- 107,116 ---- <li><A HREF="core.html#limit"><Limit></A> <li><A HREF="core.html#listen">Listen</A> <li><A HREF="core.html#listenbacklog">ListenBacklog</A> ! <li><A HREF="mod_dld.html#loadfile">LoadFile</A> (Unix) ! <li><A HREF="mod_dll.html#loadfile">LoadFile</A> (Windows) ! <li><A HREF="mod_dld.html#loadmodule">LoadModule</A> (Unix) ! <li><A HREF="mod_dll.html#loadmodule">LoadModule</A> (Windows) <li><A HREF="core.html#location"><Location></A> <li><A HREF="core.html#locationmatch"><LocationMatch></A> <li><A HREF="core.html#lockfile">LockFile</A> *************** *** 169,174 **** --- 171,177 ---- <li><A HREF="mod_env.html#setenv">SetEnv</A> <li><A HREF="mod_mime.html#sethandler">SetHandler</A> <li><A HREF="core.html#startservers">StartServers</A> + <li><A HREF="core.html#threadsperchild">ThreadsPerChild</A> <li><A HREF="core.html#timeout">TimeOut</A> <li><A HREF="mod_log_common.html#transferlog">TransferLog</A> (mod_log_common) <li><A HREF="mod_log_config.html#transferlog">TransferLog</A> (mod_log_config) 1.17 +2 -0 apache/htdocs/manual/mod/index.html Index: index.html =================================================================== RCS file: /export/home/cvs/apache/htdocs/manual/mod/index.html,v retrieving revision 1.16 retrieving revision 1.17 diff -c -C3 -r1.16 -r1.17 *** index.html 1997/07/08 19:50:40 1.16 --- index.html 1997/07/21 21:26:56 1.17 *************** *** 61,66 **** --- 61,68 ---- <dd>Basic directory handling. <dt><A HREF="mod_dld.html">mod_dld</A> <dd>Start-time linking with the GNU libdld. + <dt><A HREF="mod_dll.html">mod_dll</A> + <dd>Start-time module linking with Win32 DLLs. <dt><A HREF="mod_env.html">mod_env</A> <dd>Passing of environments to CGI scripts <dt><A HREF="mod_example.html">mod_example</A> Apache 1.2 and up 1.1 apache/htdocs/manual/mod/mod_dll.html Index: mod_dll.html =================================================================== <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Apache module mod_dll</TITLE> </HEAD> <!-- Background white, links blue (unvisited), navy (visited), red (active) --> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#000080" ALINK="#FF0000" > <!--#include virtual="header.html" --> <H1 ALIGN="CENTER">Module mod_dll</h1> This module is contained in the <code>mod_dll.c</code> file, and is not compiled in by default for Windows. It provides for loading of executable code and modules into the server at start-up time, when they are contained in Win32 DLLs.</p> <h2>Summary</h2> <p>The DLL module loads other modules into the server as it is configuring itself (the first time only, rereading the config files cannot affect the state of loaded modules), when these modules are compiled into DLL files.</p> <p>This module is included with Apache 1.3 and later, and is available only when using Microsoft Windows.</p> <h2><a name="creating">Creating DLL Modules</a></h2> <p>The Apache module API is unchanged between the Unix and Windows versions. Many modules will run on Windows with no or little change from Unix, although others rely on aspects of the Unix architecture which are not present in Windows, and will not work.</p> <p>When a module does work, it can be added to the server in one of two ways. As with Unix, it can be compiled into the server. Because Apache for Windows does not have the <code>Configure</code> program of Apache for Unix, the module's source file must be added to the ApacheCore project file, and its symbols must be added to the <code>nt\modules.c</code> file.</p> <p>The second way is to compile the module as a DLL, a shared library that can be loaded into the server at runtime, using the <code><a href="#loadmodule">LoadModule</a></code> directive. These module DLLs can be distributed and run on any Apache for Windows installation, without recompilation of the server.</p> <p>To create a module DLL, a small change is necessary to the module's source file: The module record must be exported from the DLL (which will be created later; see below). To do this, add the <code>MODULE_VAR_EXPORT</code> (defined in the Apache header files) to your module's module record definition. For example, if your module has:</p> <pre> module foo_module; </pre> <p>Replace the above with:</p> <pre> module MODULE_VAR_EXPORT foo_module; </pre> <p>Note that this will only be activated on Windows, so the module can continue to be used, unchanged, with Unix if needed. Also, if you are familiar with <code>.DEF</code> files, you can export the module record with that method instead.</p> <p>Now, create a DLL containing your module. You will need to link this against the ApacheCore.lib export library that is created when the ApacheCore.dll shared library is compiled. You may also have to change the compiler settings to ensure that the Apache header files are correctly located.</p> <p>This should create a DLL version of your module. Now simply place it in the server root, and use the <code><a href="#loadmodule">LoadModule</a></code> directive to load it.</p> <h2>Directives</h2> <ul> <li><A HREF="#loadfile">LoadFile</A> <li><A HREF="#loadmodule">LoadModule</A> </ul> <hr> <h2><A name="loadfile">LoadFile</A></h2> <strong>Syntax:</strong> LoadFile <em>filename filename ...</em><br> <Strong>Context:</strong> server config<br> <strong>Status:</strong> Core (Windows)<br> <strong>Module:</strong> mod_dll<p> The LoadFile directive links in the named object files or libraries when the server is started; this is used to load additional code which may be required for some module to work. <em>Filename</em> is relative to <A HREF="core.html#serverroot">ServerRoot</A>.<p><hr> <h2><A name="loadmodule">LoadModule</A></h2> <strong>Syntax:</strong> LoadModule <em>module filename</em><br> <Strong>Context:</strong> server config<br> <strong>Status:</strong> Core (Windows)br> <strong>Module:</strong> mod_dll<p> The LoadModule directive links in the object file or library <em>filename</em> and adds the module structure named <em>module</em> to the list of active modules. <em>Module</em> is the name of the external variable of type <code>module</code> in the file. Example: <blockquote><code> LoadModule status_module modules/ApacheModuleStatus.dll<br> </code></blockquote> loads the ApacheModuleStatus.dll module in the modules subdirectory of the ServerRoot.<p> <!--#include virtual="footer.html" --> </BODY> </HTML> 1.3 +4 -4 apache/src/nt/mod_dll.c Index: mod_dll.c =================================================================== RCS file: /export/home/cvs/apache/src/nt/mod_dll.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -C3 -r1.2 -r1.3 *** mod_dll.c 1997/07/15 21:51:56 1.2 --- mod_dll.c 1997/07/21 21:26:59 1.3 *************** *** 74,82 **** * Compiling a module as a DLL (using Microsoft Visual C++): * * 1. Add the following to the module source file's module record ! * defenition: __declspec(dllexport). i.e. if you have * "module foo_module;", replace it with ! * "module __declspec(dllexport) foo_module;". If your module is to be * compiled with both Windows and Unix, you may wish to use an #ifdef * WIN32 * --- 74,82 ---- * Compiling a module as a DLL (using Microsoft Visual C++): * * 1. Add the following to the module source file's module record ! * definition: MODULE_VAR_EXPORT. i.e. if you have * "module foo_module;", replace it with ! * "module MODULE+VAR_EXPORT foo_module;". If your module is to be * compiled with both Windows and Unix, you may wish to use an #ifdef * WIN32 * *************** *** 85,92 **** * as a DLL. * * 2. Create a DLL file with just the module source file (and any associated ! * files). Be sure to link it against the libapache.lib created when ! * compiling libapache.dll. You may also have to tweak the settings to * find all of the Apache includes files correctly. After creating the * DLL, follow the above instructions to load it into Apache. */ --- 85,92 ---- * as a DLL. * * 2. Create a DLL file with just the module source file (and any associated ! * files). Be sure to link it against the ApacheCore.lib created when ! * compiling ApacheCore.dll. You may also have to tweak the settings to * find all of the Apache includes files correctly. After creating the * DLL, follow the above instructions to load it into Apache. */