Mercurial > hg > nginx-site
annotate xml/en/docs/howto_build_on_win32.xml @ 3094:f7e9bd7de0f9 default tip
freenginx-1.27.3
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 13 Aug 2024 17:45:23 +0300 |
parents | 0083dce686ec |
children |
rev | line source |
---|---|
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
2 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
5 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
461
diff
changeset
|
6 |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
7 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd"> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
8 |
853
d1446e47d17d
Unified on the look of titles.
Ruslan Ermilov <ru@nginx.com>
parents:
700
diff
changeset
|
9 <article name="Building nginx on the Win32 platform with Visual C" |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
10 link="/en/docs/howto_build_on_win32.html" |
589 | 11 lang="en" |
3054
0083dce686ec
Free nginx: repository links.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3017
diff
changeset
|
12 rev="27"> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
13 |
121
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
119
diff
changeset
|
14 <section name="Prerequisites"> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
15 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
16 <para> |
128
5530e24f9d58
* reg symbol replaced with 'registered' tags
Sergey Budnevitch <sb@waeme.net>
parents:
123
diff
changeset
|
17 To build nginx on the <registered>Microsoft Win32</registered> platform you need: |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
18 |
461 | 19 <list type="bullet"> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
20 |
461 | 21 <listitem> |
128
5530e24f9d58
* reg symbol replaced with 'registered' tags
Sergey Budnevitch <sb@waeme.net>
parents:
123
diff
changeset
|
22 Microsoft Visual C compiler. <registered>Microsoft Visual Studio</registered> |
5530e24f9d58
* reg symbol replaced with 'registered' tags
Sergey Budnevitch <sb@waeme.net>
parents:
123
diff
changeset
|
23 8 and 10 are known to work. |
461 | 24 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
25 |
461 | 26 <listitem> |
2682 | 27 <link url="https://sourceforge.net/projects/mingw/files/MSYS/">MSYS</link> or |
28 <link url="https://www.msys2.org">MSYS2</link>. | |
461 | 29 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
30 |
461 | 31 <listitem> |
128
5530e24f9d58
* reg symbol replaced with 'registered' tags
Sergey Budnevitch <sb@waeme.net>
parents:
123
diff
changeset
|
32 Perl, if you want to build <registered>OpenSSL</registered> and nginx with SSL support. |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
33 For example <link url="http://www.activestate.com/activeperl">ActivePerl</link> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
34 or <link url="http://strawberryperl.com">Strawberry Perl</link>. |
461 | 35 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
36 |
461 | 37 <listitem> |
1775
a469e77d446f
Fixed links to Mercurial SCM site.
Ruslan Ermilov <ru@nginx.com>
parents:
1749
diff
changeset
|
38 <link url="https://www.mercurial-scm.org">Mercurial</link> client. |
461 | 39 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
40 |
461 | 41 <listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
42 <link url="http://www.pcre.org">PCRE</link>, <link url="http://zlib.net">zlib</link> |
118
b2462c2e2e47
o OpenSSL, Visual Studio, Subversion, Win32 are trademarks.
Maxim Konovalov <maxim@nginx.com>
parents:
117
diff
changeset
|
43 and <link url="http://www.openssl.org">OpenSSL</link> libraries sources. |
461 | 44 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
45 </list> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
46 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
47 </para> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
48 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
49 </section> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
50 |
121
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
119
diff
changeset
|
51 <section id="build_steps" |
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
119
diff
changeset
|
52 name="Build steps"> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
53 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
54 <para> |
889
675f5c67b45c
Source code repository switch to Mercurial.
Maxim Dounin <mdounin@mdounin.ru>
parents:
859
diff
changeset
|
55 Ensure that paths to Perl, Mercurial and MSYS bin directories are added to |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
56 PATH environment variable before you start build. To set Visual C environment |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
57 run vcvarsall.bat script from Visual C directory. |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
58 </para> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
59 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
60 <para> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
61 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
62 To build nginx: |
461 | 63 <list type="bullet"> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
64 |
461 | 65 <listitem> |
128
5530e24f9d58
* reg symbol replaced with 'registered' tags
Sergey Budnevitch <sb@waeme.net>
parents:
123
diff
changeset
|
66 Start MSYS bash. |
461 | 67 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
68 |
461 | 69 <listitem> |
3054
0083dce686ec
Free nginx: repository links.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3017
diff
changeset
|
70 Check out nginx sources from the freenginx.org/hg/nginx repository. |
0083dce686ec
Free nginx: repository links.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3017
diff
changeset
|
71 For example: |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
72 <programlisting> |
3054
0083dce686ec
Free nginx: repository links.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3017
diff
changeset
|
73 hg clone http://freenginx.org/hg/nginx |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
74 </programlisting> |
461 | 75 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
76 |
461 | 77 <listitem> |
119 | 78 Create a build and lib directories, and unpack zlib, PCRE and OpenSSL libraries |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
79 sources into lib directory: |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
80 <programlisting> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
81 mkdir objs |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
82 mkdir objs/lib |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
83 cd objs/lib |
2821
06c7520f1181
Updated OpenSSL and PCRE versions used for win32 builds.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2764
diff
changeset
|
84 tar -xzf ../../pcre2-10.39.tar.gz |
3017
f55e18559df9
Updated OpenSSL and zlib versions.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2821
diff
changeset
|
85 tar -xzf ../../zlib-1.3.tar.gz |
f55e18559df9
Updated OpenSSL and zlib versions.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2821
diff
changeset
|
86 tar -xzf ../../openssl-3.0.10.tar.gz |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
87 </programlisting> |
461 | 88 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
89 |
461 | 90 <listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
91 Run configure script: |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
92 <programlisting> |
2060
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
93 auto/configure \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
94 --with-cc=cl \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
95 --with-debug \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
96 --prefix= \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
97 --conf-path=conf/nginx.conf \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
98 --pid-path=logs/nginx.pid \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
99 --http-log-path=logs/access.log \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
100 --error-log-path=logs/error.log \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
101 --sbin-path=nginx.exe \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
102 --http-client-body-temp-path=temp/client_body_temp \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
103 --http-proxy-temp-path=temp/proxy_temp \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
104 --http-fastcgi-temp-path=temp/fastcgi_temp \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
105 --http-scgi-temp-path=temp/scgi_temp \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
106 --http-uwsgi-temp-path=temp/uwsgi_temp \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
107 --with-cc-opt=-DFD_SETSIZE=1024 \ |
2821
06c7520f1181
Updated OpenSSL and PCRE versions used for win32 builds.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2764
diff
changeset
|
108 --with-pcre=objs/lib/pcre2-10.39 \ |
3017
f55e18559df9
Updated OpenSSL and zlib versions.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2821
diff
changeset
|
109 --with-zlib=objs/lib/zlib-1.3 \ |
f55e18559df9
Updated OpenSSL and zlib versions.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2821
diff
changeset
|
110 --with-openssl=objs/lib/openssl-3.0.10 \ |
2060
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
111 --with-openssl-opt=no-asm \ |
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
112 --with-http_ssl_module |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
113 </programlisting> |
461 | 114 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
115 |
461 | 116 <listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
117 Run make: |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
118 <programlisting> |
2060
237b67ef69a6
Improved win32 build instructions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2018
diff
changeset
|
119 nmake |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
120 </programlisting> |
461 | 121 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
122 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
123 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
124 </list> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
125 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
126 </para> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
127 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
128 </section> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
129 |
121
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
119
diff
changeset
|
130 <section id="see_also" |
49443032011c
Unified <section> syntax for "article" and "module" documents.
Ruslan Ermilov <ru@nginx.com>
parents:
119
diff
changeset
|
131 name="See also"> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
132 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
133 <para> |
461 | 134 <list type="bullet"> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
135 |
461 | 136 <listitem> |
374
a413dffb0557
Replaced "a href" with "link doc" / "link url".
Ruslan Ermilov <ru@nginx.com>
parents:
221
diff
changeset
|
137 <link doc="windows.xml"/> |
461 | 138 </listitem> |
113
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
139 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
140 </list> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
141 </para> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
142 |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
143 </section> |
f9fe7330f8e8
Win32 build instructions added
Sergey Budnevitch <sb@waeme.net>
parents:
diff
changeset
|
144 </article> |