Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nginx
GitHub Repository: nginx/nginx.org
Path: blob/main/xml/en/docs/howto_build_on_win32.xml
1 views
1
<?xml version="1.0"?>
2
3
<!--
4
Copyright (C) Nginx, Inc.
5
-->
6
7
<!DOCTYPE article SYSTEM "../../../dtd/article.dtd">
8
9
<article name="Building nginx on the Win32 platform with Visual C"
10
link="/en/docs/howto_build_on_win32.html"
11
lang="en"
12
rev="29">
13
14
<section name="Prerequisites">
15
16
<para>
17
To build nginx on the <registered>Microsoft Win32</registered> platform you need:
18
19
<list type="bullet">
20
21
<listitem>
22
Microsoft Visual C compiler. <registered>Microsoft Visual Studio</registered>
23
8, 10, 17 are known to work.
24
</listitem>
25
26
<listitem>
27
<link url="https://sourceforge.net/projects/mingw/files/MSYS/">MSYS</link> or
28
<link url="https://www.msys2.org">MSYS2</link>.
29
</listitem>
30
31
<listitem>
32
Perl, if you want to build <registered>OpenSSL</registered> and nginx with SSL support.
33
For example <link url="http://www.activestate.com/activeperl">ActivePerl</link>
34
or <link url="http://strawberryperl.com">Strawberry Perl</link>.
35
</listitem>
36
37
<listitem>
38
<link url="https://cli.github.com/">Git</link> client.
39
</listitem>
40
41
<listitem>
42
<link url="http://www.pcre.org">PCRE</link>, <link url="http://zlib.net">zlib</link>
43
and <link url="http://www.openssl.org">OpenSSL</link> libraries sources.
44
</listitem>
45
</list>
46
47
</para>
48
49
</section>
50
51
<section id="build_steps"
52
name="Build steps">
53
54
<para>
55
Ensure that paths to Perl, Git and MSYS bin directories are added to
56
PATH environment variable before you start build. To set Visual C environment
57
run vcvarsall.bat script from Visual C directory.
58
</para>
59
60
<para>
61
62
To build nginx:
63
<list type="bullet">
64
65
<listitem>
66
Start MSYS bash.
67
</listitem>
68
69
<listitem>
70
Check out nginx sources from the GitHub repository:
71
<programlisting>
72
git clone https://github.com/nginx/nginx.git
73
</programlisting>
74
</listitem>
75
76
<listitem>
77
Create a build and lib directories, and unpack zlib, PCRE and OpenSSL libraries
78
sources into lib directory:
79
<programlisting>
80
mkdir objs
81
mkdir objs/lib
82
cd objs/lib
83
tar -xzf ../../pcre2-10.39.tar.gz
84
tar -xzf ../../zlib-1.3.1.tar.gz
85
tar -xzf ../../openssl-3.0.14.tar.gz
86
</programlisting>
87
</listitem>
88
89
<listitem>
90
Run configure script:
91
<programlisting>
92
auto/configure \
93
--with-cc=cl \
94
--with-debug \
95
--prefix= \
96
--conf-path=conf/nginx.conf \
97
--pid-path=logs/nginx.pid \
98
--http-log-path=logs/access.log \
99
--error-log-path=logs/error.log \
100
--sbin-path=nginx.exe \
101
--http-client-body-temp-path=temp/client_body_temp \
102
--http-proxy-temp-path=temp/proxy_temp \
103
--http-fastcgi-temp-path=temp/fastcgi_temp \
104
--http-scgi-temp-path=temp/scgi_temp \
105
--http-uwsgi-temp-path=temp/uwsgi_temp \
106
--with-cc-opt=-DFD_SETSIZE=1024 \
107
--with-pcre=objs/lib/pcre2-10.39 \
108
--with-zlib=objs/lib/zlib-1.3.1 \
109
--with-openssl=objs/lib/openssl-3.0.14 \
110
--with-openssl-opt=no-asm \
111
--with-http_ssl_module
112
</programlisting>
113
</listitem>
114
115
<listitem>
116
Run make:
117
<programlisting>
118
nmake
119
</programlisting>
120
</listitem>
121
122
123
</list>
124
125
</para>
126
127
</section>
128
129
<section id="see_also"
130
name="See also">
131
132
<para>
133
<list type="bullet">
134
135
<listitem>
136
<link doc="windows.xml"/>
137
</listitem>
138
139
</list>
140
</para>
141
142
</section>
143
</article>
144
145