]> granicus.if.org Git - apache/blob - docs/manual/platform/win_compiling.html.en
update transformation
[apache] / docs / manual / platform / win_compiling.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>Compiling Apache for Microsoft Windows - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body id="manual-page"><div id="page-header">
14 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
15 <p class="apache">Apache HTTP Server Version 2.1</p>
16 <img alt="" src="../images/feather.gif" /></div>
17 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
18 <div id="path">
19 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.1</a> &gt; <a href="./">Platform Specific Notes</a></div><div id="page-content"><div id="preamble"><h1>Compiling Apache for Microsoft Windows</h1>
20 <div class="toplang">
21 <p><span>Available Languages: </span><a href="../en/platform/win_compiling.html" title="English">&nbsp;en&nbsp;</a> |
22 <a href="../ko/platform/win_compiling.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
23 </div>
24
25
26     <p>There are many important points before you begin compiling
27     Apache. See <a href="windows.html">Using Apache with Microsoft
28     Windows</a> before you begin.</p>
29
30   </div>
31 <div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#requirements">Requirements</a></li>
32 <li><img alt="" src="../images/down.gif" /> <a href="#commandbuild">Command-Line Build</a></li>
33 <li><img alt="" src="../images/down.gif" /> <a href="#workspacebuild">Developer Studio Workspace IDE Build</a></li>
34 <li><img alt="" src="../images/down.gif" /> <a href="#projectcomponents">Project Components</a></li>
35 </ul></div>
36 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
37 <div class="section">
38 <h2><a name="requirements" id="requirements">Requirements</a></h2>
39
40     
41
42     <p>Compiling Apache requires the following environment to be
43     properly installed:</p>
44
45     <ul>
46       <li>
47         <p>Disk Space</p>
48         <p>Make sure you have at least 50 MB of free disk space
49         available. After installation Apache requires approximately
50         10 MB of disk space, plus space for log and cache files,
51         which can grow rapidly. The actual disk space requirements
52         will vary considerably based on your chosen configuration and
53         any third-party modules or libraries.</p>
54       </li>
55
56       <li>
57         <p>Microsoft Visual C++ 5.0 or higher.</p>
58         <p>Apache can be built using the command line tools, or from
59         within the Visual Studio IDE Workbench.  The command line
60         build requires the environment to reflect the <code>PATH</code>,
61         <code>INCLUDE</code>, <code>LIB</code> and other variables
62         that can be configured with the <code>vcvars32</code> batch file:</p>
63
64         <div class="example"><p><code>
65           "c:\Program Files\DevStudio\VC\Bin\vcvars32.bat"
66         </code></p></div>
67       </li>
68
69       <li>
70         <p>The Windows Platform SDK.</p>
71         <p>Visual C++ 5.0 builds require an updated Microsoft Windows
72         Platform SDK to enable some Apache features. For command line
73         builds, the Platform SDK environment is prepared by the
74         <code>setenv</code> batch file:</p>
75
76         <div class="example"><p><code>
77           "c:\Program Files\Platform SDK\setenv.bat"
78         </code></p></div>
79
80         <p>The Platform SDK files distributed with Visual C++ 6.0 and
81         later are sufficient, so users of later version may skip
82         this requirement.</p>
83
84         <div class="note">Note that the Windows Platform SDK update is required
85         to enable all supported <code class="module"><a href="../mod/mod_isapi.html">mod_isapi</a></code> features.
86         Without a recent update, Apache will issue warnings under
87         MSVC++ 5.0 that some <code class="module"><a href="../mod/mod_isapi.html">mod_isapi</a></code> features
88         will be disabled. Look for the update at <a href="http://msdn.microsoft.com/downloads/sdks/platform/platform.asp">http://msdn.microsoft.com/downloads/sdks/platform/platform.asp</a>.</div>
89       </li>
90
91       <li>
92         <p>The awk utility (awk, gawk or similar).</p>
93         <p>To install Apache within the build system, several files are
94         modified using the <code>awk.exe</code> utility. awk was chosen since it
95         is a very small download (compared with Perl or WSH/VB) and
96         accomplishes the task of generating files. Brian Kernighan's
97         <a href="http://cm.bell-labs.com/cm/cs/who/bwk/">http://cm.bell-labs.com/cm/cs/who/bwk/</a>
98         site has a compiled native Win32 binary,
99         <a href="http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe">http://cm.bell-labs.com/cm/cs/who/bwk/awk95.exe</a> which
100         you must save with the name <code>awk.exe</code> rather than
101         <code>awk95.exe</code>.</p>
102
103         <div class="note">Note that Developer Studio IDE will only find
104         <code>awk.exe</code> from the Tools menu Options... Directories
105         tab (the Projects - VC++ Directories pane in Developer Studio 7.0)
106         listing Executable file paths. Add the path for <code>awk.exe</code>
107         to this list, and your system <code>PATH</code> environment variable,
108         as needed.</div>
109
110         <div class="note">Also note that if you are using Cygwin (<a href="http://www.cygwin.com/">http://www.cygwin.com/</a>) the awk utility is named <code>gawk.exe</code> and
111         that the file <code>awk.exe</code> is really a symlink to the <code>gawk.exe</code>
112         file. The Windows command shell does not recognize symlinks, and because of that
113         building InstallBin will fail. A workaround is to delete <code>awk.exe</code> from
114         the cygwin installation and rename <code>gawk.exe</code> to <code>awk.exe</code>.</div>
115       </li>
116
117       <li>
118         <p>[Optional] OpenSSL libraries (for <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>
119         and <code>ab.exe</code> with ssl support)</p>
120         <p><strong>Caution: there are significant restrictions and
121         prohibitions on the use and distribution of strong cryptography
122         and patented intellectual property throughout the world.</strong>
123         OpenSSL includes strong cryptography controlled by both export
124         regulations and domestic law, as well as intellectual property
125         protected by patent, in the United States and elsewhere.  Neither
126         the Apache Software Foundation nor the OpenSSL project can provide
127         legal advise regarding possession, use, or distribution of the code
128         provided by the OpenSSL project. <strong>Consult your own legal
129         counsel, you are responsible for your own actions.</strong></p>
130
131         <p>OpenSSL must be installed into a <code>srclib</code> subdirectory named
132         <code>openssl</code>, obtained from <a href="http://www.openssl.org/source/">http://www.openssl.org/source/</a>, in order to compile <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>
133         or the abs project (<code>ab.exe</code> with SSL support.) To prepare OpenSSL
134         for both <code>release</code> and <code>debug</code> builds of Apache, and
135         disable the patent protected features in 0.9.7,  you might use the following
136         build commands:</p>
137
138         <div class="example"><p><code>
139           perl Configure VC-WIN32<br />
140           perl util\mkfiles.pl &gt;MINFO<br />
141           perl util\mk1mf.pl dll no-asm no-mdc2 no-rc5 no-idea VC-WIN32 &gt;makefile<br />
142           perl util\mk1mf.pl dll debug no-asm no-mdc2 no-rc5 no-idea VC-WIN32 &gt;makefile.dbg<br />
143           perl util\mkdef.pl 32 libeay no-asm no-mdc2 no-rc5 no-idea &gt;ms\libeay32.def<br />
144           perl util\mkdef.pl 32 ssleay no-asm no-mdc2 no-rc5 no-idea &gt;ms\ssleay32.def<br />
145           nmake<br />
146           nmake -f makefile.dbg
147         </code></p></div>
148
149       </li>
150
151       <li>
152         <p>[Optional] zlib sources (for <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>)</p>
153         <p>Zlib must be installed into a <code>srclib</code> subdirectory named
154         <code>zlib</code>, however those sources need not be compiled. The build system
155         will compile the compression sources directly into the <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>
156         module. Zlib can be obtained from <a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a> -- <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code> is
157         confirmed to build correctly with version 1.1.4.</p>
158       </li>
159
160     </ul>
161
162   </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
163 <div class="section">
164 <h2><a name="commandbuild" id="commandbuild">Command-Line Build</a></h2>
165
166     
167
168     <p>First, unpack the Apache distribution into an appropriate
169     directory. Open a command-line prompt and <code>cd</code> to that
170     directory.</p>
171
172     <p>The master Apache makefile instructions are contained in the
173     <code>Makefile.win</code> file. To compile Apache on Windows
174     NT, simply use one of the following commands to compiled the
175     <code>release</code> or <code>debug</code> build, respectively:</p>
176
177     <div class="example"><pre>
178 nmake /f Makefile.win _apacher
179
180 nmake /f Makefile.win _apached
181     </pre></div>
182
183     <p>Either command will compile Apache. The latter will include
184     debugging information in the resulting files, making it easier
185     to find bugs and track down problems.</p>
186
187   </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
188 <div class="section">
189 <h2><a name="workspacebuild" id="workspacebuild">Developer Studio Workspace IDE Build</a></h2>
190
191     
192
193     <p>Apache can also be compiled using VC++'s Visual Studio
194     development environment. To simplify this process, a
195     Visual Studio workspace, <code>Apache.dsw</code>, is provided.
196     This workspace exposes the entire list of working <code>.dsp</code>
197     projects that are required for the complete Apache binary release.
198     It includes dependencies between the projects to assure that they
199     are built in the appropriate order.</p>
200
201     <p>Open the <code>Apache.dsw</code> workspace, and select
202     <code>InstallBin</code> (<code>Release</code> or <code>Debug</code> build,
203     as desired) as the Active Project. <code>InstallBin</code> causes all
204     related project to be built, and then invokes <code>Makefile.win</code> to
205     move the compiled executables and dlls. You may personalize the
206     <code>INSTDIR=</code> choice by changing <code>InstallBin</code>'s Settings,
207     General tab, Build command line entry. <code>INSTDIR</code> defaults to the
208     <code>/Apache2</code> directory. If you only want a test compile (without
209     installing) you may build the <code>BuildBin</code> project instead.</p>
210
211     <p>The <code>.dsp</code> project files are distributed in Visual
212     C++ 6.0 format. Visual C++ 5.0 (97) will recognize them. Visual C++
213     7.0 (.net) must convert <code>Apache.dsw</code> plus the <code>.dsp</code>
214     files into an <code>Apache.sln</code> plus <code>.msproj</code> files,
215     be sure you reconvert the <code>.msproj</code> file if any of the source
216     <code>.dsp</code> files change! This is really trivial, just open
217     <code>Apache.dsw</code> in the VC++ 7.0 IDE once again.</p>
218
219     <p>Visual C++ 7.0 (.net) users should also use the Build
220     menu, Configuration Manager dialog to uncheck both the <code>Debug</code>
221     and <code>Release</code> Solution modules abs, <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>
222     and <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>.
223     These modules are built by invoking <code>nmake</code> or the IDE directly
224     with the <code>BinBuild</code> target to build those modules explicitly,
225     only if the <code>srclib</code> directories <code>openssl</code>
226     and/or <code>zlib</code> exist.</p>
227
228     <p>Exported <code>.mak</code> files pose a greater hassle, but they are
229     required for Visual C++ 5.0 users to build <code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>,
230     abs (<code class="program"><a href="../programs/ab.html">ab</a></code> with SSL support) and/or
231     <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>.
232     VC++ 7.0 (.net) users also benefit, <code>nmake</code> builds
233     are faster than <code>binenv</code> builds.
234     Build the entire project from within the VC++ 5.0 or 6.0 IDE,
235     then use the Project Menu Export for all makefiles.
236     You must build the projects first in order to create all dynamic
237     auto-generated targets, so that dependencies can be parsed
238     correctly. Run the following command to fix the paths so they
239     will build anywhere:</p>
240
241     <div class="example"><p><code>
242       perl srclib\apr\build\fixwin32mak.pl
243     </code></p></div>
244
245     <p>You must type this command from the <em>top level</em>
246     directory of the httpd source tree. Every
247     <code>.mak</code> and <code>.dep</code> project file within
248     the current directory and below will be corrected, and the
249     timestamps adjusted to reflect the <code>.dsp</code>.</p>
250
251     <p>If you contribute back a patch that revises project files, we
252     must commit project files in Visual Studio 6.0 format. Changes
253     should be simple, with minimal compilation and linkage flags that
254     will be recognized by all VC++ 5.0 through 7.0 environments.</p>
255
256   </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
257 <div class="section">
258 <h2><a name="projectcomponents" id="projectcomponents">Project Components</a></h2>
259
260     
261
262     <p>The <code>Apache.dsw</code> workspace and <code>makefile.win</code>
263     <code>nmake</code> script both build the <code>.dsp</code> projects
264     of the Apache server in the following sequence:</p>
265
266     <ol>
267       <li><code>srclib\apr\apr.dsp</code></li>
268
269       <li><code>srclib\apr\libapr.dsp</code></li>
270
271       <li><code>srclib\apr-util\uri\gen_uri_delims.dsp</code></li>
272
273       <li><code>srclib\apr-util\xml\expat\lib\xml.dsp</code></li>
274
275       <li><code>srclib\apr-util\aprutil.dsp</code></li>
276
277       <li><code>srclib\apr-util\libaprutil.dsp</code></li>
278
279       <li><code>srclib\pcre\dftables.dsp</code></li>
280
281       <li><code>srclib\pcre\pcre.dsp</code></li>
282
283       <li><code>srclib\pcre\pcreposix.dsp</code></li>
284
285       <li><code>server\gen_test_char.dsp</code></li>
286
287       <li><code>libhttpd.dsp</code></li>
288
289       <li><code>Apache.dsp</code></li>
290     </ol>
291
292     <p>In addition, the <code>modules\</code> subdirectory tree contains
293     project files for the majority of the modules.</p>
294
295     <p>The <code>support\</code> directory contains project files for
296     additional programs that are not part of the Apache runtime,
297     but are used by the administrator to test Apache and maintain
298     password and log files. Windows-specific support projects are
299     broken out in the <code>support\win32\</code> directory.</p>
300
301     <ol>
302       <li><code>support\ab.dsp</code></li>
303
304       <li><code>support\htdigest.dsp</code></li>
305
306       <li><code>support\htpasswd.dsp</code></li>
307
308       <li><code>support\logresolve.dsp</code></li>
309
310       <li><code>support\rotatelogs.dsp</code></li>
311
312       <li><code>support\win32\ApacheMonitor.dsp</code></li>
313
314       <li><code>support\win32\wintty.dsp</code></li>
315     </ol>
316
317     <p>Once Apache has been compiled, it needs to be installed in
318     its server root directory. The default is the
319     <code>\Apache2</code> directory, of the same drive.</p>
320
321     <p>To build and install all the files into the desired folder
322     <em>dir</em> automatically, use one of the following
323     <code>nmake</code> commands:</p>
324
325     <div class="example"><pre>
326 nmake /f Makefile.win installr INSTDIR=<em>dir</em>
327
328 nmake /f Makefile.win installd INSTDIR=<em>dir</em>
329     </pre></div>
330
331     <p>The <em>dir</em> argument to <code>INSTDIR</code> gives
332     the installation directory; it can be omitted if Apache is
333     to be installed into <code>\Apache2</code>.</p>
334
335     <p>This will install the following:</p>
336
337     <ul>
338       <li><code><em>dir</em>\bin\Apache.exe</code> - Apache
339       executable</li>
340
341       <li><code><em>dir</em>\bin\ApacheMonitor.exe</code> - Service
342       monitor taskbar icon utility</li>
343
344       <li><code><em>dir</em>\bin\htdigest.exe</code> - Digest auth
345       password file utility</li>
346
347       <li><code><em>dir</em>\bin\htdbm.exe</code> - SDBM auth
348       database password file utility</li>
349
350       <li><code><em>dir</em>\bin\htpasswd.exe</code> - Basic auth
351       password file utility</li>
352
353       <li><code><em>dir</em>\bin\logresolve.exe</code> - Log file
354       dns name lookup utility</li>
355
356       <li><code><em>dir</em>\bin\rotatelogs.exe</code> - Log file
357       cycling utility</li>
358
359       <li><code><em>dir</em>\bin\wintty.exe</code> - Console window
360       utility</li>
361
362       <li><code><em>dir</em>\bin\libapr.dll</code> - Apache
363       Portable Runtime shared library</li>
364
365       <li><code><em>dir</em>\bin\libaprutil.dll</code> - Apache
366       Utility Runtime shared library</li>
367
368       <li><code><em>dir</em>\bin\libhttpd.dll</code> - Apache Core
369       library</li>
370
371       <li><code><em>dir</em>\modules\mod_*.so</code> - Loadable
372       Apache modules</li>
373
374       <li><code><em>dir</em>\conf</code> - Configuration
375       directory</li>
376
377       <li><code><em>dir</em>\logs</code> - Empty logging
378       directory</li>
379
380       <li><code><em>dir</em>\include</code> - C language header
381       files</li>
382
383       <li><code><em>dir</em>\lib</code> - Link library files</li>
384     </ul>
385
386     <h3><a name="projectcomponents-warn" id="projectcomponents-warn">Warning about building Apache from the development tree</a></h3>
387
388       
389
390       <div class="note">Note only the <code>.dsp</code> files are maintained between <code>release</code>
391       builds. The <code>.mak</code> files are NOT regenerated, due to the tremendous
392       waste of reviewer's time. Therefore, you cannot rely on the <code>NMAKE</code>
393       commands above to build revised <code>.dsp</code> project files unless you
394       then export all <code>.mak</code> files yourself from the project. This is
395       unnecessary if you build from within the Microsoft
396       Developer Studio environment.</div>
397
398       <div class="note">Also note it is very worthwhile to build the <code>BuildBin</code>
399       target project (or the command line <code>_apacher</code> or
400       <code>_apached</code> target) prior to exporting the make files.
401       Many files are autogenerated in the build process. Only a full
402       build provides all of the dependent files required to build proper
403       dependency trees for correct build behavior.</div>
404
405       <p>In order to create distribution <code>.mak</code> files, always review
406       the generated <code>.mak</code> (or <code>.dep</code>) dependencies for
407       Platform SDK or other garbage includes. The <code>DevStudio\SharedIDE\bin\</code>
408       (VC5) or <code>DevStudio\Common\MSDev98\bin\</code> (VC6) directory contains
409       the <code>sysincl.dat</code> file, which must list all exceptions. Update this
410       file (including both forward and backslashed paths, such as both
411       <code>sys/time.h</code> and <code>sys\time.h</code>) to include such dependencies.
412       Including local-install paths in a distributed <code>.mak</code> file will
413       cause the build to fail completely. And don't forget to run
414       <code>srclib/apr/build/fixwin32mak.pl</code> in order to fix absolute
415       paths within the <code>.mak</code> files.</p>
416
417     
418
419   </div></div>
420 <div class="bottomlang">
421 <p><span>Available Languages: </span><a href="../en/platform/win_compiling.html" title="English">&nbsp;en&nbsp;</a> |
422 <a href="../ko/platform/win_compiling.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a></p>
423 </div><div id="footer">
424 <p class="apache">Copyright 1999-2004 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
425 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
426 </body></html>