comparison xml/en/docs/configure.xml @ 924:a2aea48ff155

New "installation" article. Old "installation" was renamed to "configure" and describes how to build nginx from sources.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 31 May 2013 13:05:51 +0400
parents xml/en/docs/install.xml@65e75e59a714
children eea7541e7c6a
comparison
equal deleted inserted replaced
923:4f1e2120be5e 924:a2aea48ff155
1 <!--
2 Copyright (C) Igor Sysoev
3 Copyright (C) Nginx, Inc.
4 -->
5
6 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd">
7
8 <article name="Building nginx from Sources"
9 link="/en/docs/configure.html"
10 lang="en"
11 rev="4">
12
13 <section>
14
15 <para>
16 The build is configured using the <command>configure</command> command.
17 It defines various aspects of the system, including the methods nginx
18 is allowed to use for connection processing.
19 At the end it creates a <path>Makefile</path>.
20 The <command>configure</command> command supports the following parameters:
21 <list type="bullet">
22
23 <listitem>
24 <para>
25 <literal>--prefix=<value>path</value></literal>&mdash;defines
26 a directory that will keep server files.
27 This same directory will also be used for all relative paths set by
28 <command>configure</command> (except for paths to libraries sources)
29 and in the <path>nginx.conf</path> configuration file.
30 It is set to the <path>/usr/local/nginx</path> directory by default.
31 </para>
32 </listitem>
33
34 <listitem>
35 <para>
36 <literal>--sbin-path=<value>path</value></literal>&mdash;sets
37 the name of an nginx executable file.
38 This name is used only during installation.
39 By default the file is named
40 <path><value>prefix</value>/sbin/nginx</path>.
41 </para>
42 </listitem>
43
44 <listitem>
45 <para>
46 <literal>--conf-path=<value>path</value></literal>&mdash;sets
47 the name of an <path>nginx.conf</path> configuration file.
48 If needs be, nginx can always be started with a different configuration file,
49 by specifying it in the command-line parameter
50 <nobr><literal>-c <value>file</value></literal></nobr>.
51 By default the file is named
52 <path><value>prefix</value>/conf/nginx.conf</path>.
53 </para>
54 </listitem>
55
56 <listitem>
57 <para>
58 <literal>--pid-path=<value>path</value></literal>&mdash;sets
59 the name of an nginx.pid file that will store the process ID
60 of the main process.
61 After installation, the file name can always be changed in the
62 <path>nginx.conf</path> configuration file using the
63 <link doc="ngx_core_module.xml" id="pid"/> directive.
64 By default the file is named
65 <path><value>prefix</value>/logs/nginx.pid</path>.
66 </para>
67 </listitem>
68
69 <listitem>
70 <para>
71 <literal>--error-log-path=<value>path</value></literal>&mdash;sets
72 the name of the primary error, warnings, and diagnostic file.
73 After installation, the file name can always be changed in the
74 <path>nginx.conf</path> configuration file using the
75 <link doc="ngx_core_module.xml" id="error_log"/> directive.
76 By default the file is named
77 <path><value>prefix</value>/logs/error.log</path>.
78 </para>
79 </listitem>
80
81 <listitem>
82 <para>
83 <literal>--http-log-path=<value>path</value></literal>&mdash;sets
84 the name of the primary request log file of the HTTP server.
85 After installation, the file name can always be changed in the
86 <path>nginx.conf</path> configuration file using the
87 <link doc="http/ngx_http_log_module.xml" id="access_log"/> directive.
88 By default the file is named
89 <path><value>prefix</value>/logs/access.log</path>.
90 </para>
91 </listitem>
92
93 <listitem>
94 <para>
95 <literal>--user=<value>name</value></literal>&mdash;sets
96 the name of an unprivileged user whose credentials will be used
97 by worker processes.
98 After installation, the name can always be changed in the
99 <path>nginx.conf</path> configuration file using the
100 <link doc="ngx_core_module.xml" id="user"/> directive.
101 The default user name is nobody.
102 </para>
103 </listitem>
104
105 <listitem>
106 <para>
107 <literal>--group=<value>name</value></literal>&mdash;sets
108 the name of a group whose credentials will be used
109 by worker processes.
110 After installation, the name can always be changed in the
111 <path>nginx.conf</path> configuration file using the
112 <link doc="ngx_core_module.xml" id="user"/> directive.
113 By default, a group name is set to the name of an unprivileged user.
114 </para>
115 </listitem>
116
117 <listitem>
118 <para>
119 <literal>--with-select_module</literal><br/>
120 <literal>--without-select_module</literal>&mdash;enables or disables
121 building a module that allows the server to work with the
122 <c-func>select</c-func> method.
123 This module is built automatically if the platform does not appear
124 to support more appropriate methods such as kqueue, epoll, rtsig, or /dev/poll.
125 </para>
126 </listitem>
127
128 <listitem>
129 <para>
130 <literal>--with-poll_module</literal><br/>
131 <literal>--without-poll_module</literal>&mdash;enables or disables
132 building a module that allows the server to work with the
133 <c-func>poll</c-func> method.
134 This module is built automatically if the platform does not appear
135 to support more appropriate methods such as kqueue, epoll, rtsig, or /dev/poll.
136 </para>
137 </listitem>
138
139 <listitem>
140 <para>
141 <literal>--without-http_gzip_module</literal>&mdash;disables building a module
142 that <link doc="http/ngx_http_gzip_module.xml">compresses responses</link>
143 of an HTTP server.
144 The zlib library is required to build and run this module.
145 </para>
146 </listitem>
147
148 <listitem>
149 <para>
150 <literal>--without-http_rewrite_module</literal>&mdash;disables building a
151 module that allows an HTTP server to
152 <link doc="http/ngx_http_rewrite_module.xml">redirect requests and change URI
153 of requests</link>.
154 The PCRE library is required to build and run this module.
155 </para>
156 </listitem>
157
158 <listitem>
159 <para>
160 <literal>--without-http_proxy_module</literal>&mdash;disables building an
161 HTTP server <link doc="http/ngx_http_proxy_module.xml">proxying module</link>.
162 <!--
163 The MD5 library is required to build and run this module.
164 -->
165 </para>
166 </listitem>
167
168 <listitem>
169 <para>
170 <literal>--with-http_ssl_module</literal>&mdash;enables building a module
171 that adds the <link doc="http/ngx_http_ssl_module.xml">HTTPS protocol
172 support</link> to an HTTP server.
173 This module is not built by default.
174 The OpenSSL library is required to build and run this module.
175 </para>
176 </listitem>
177
178 <listitem>
179 <para>
180 <literal>--with-pcre=<value>path</value></literal>&mdash;sets
181 the path to the sources of the PCRE library.
182 The library distribution (version
183 4.4&mdash;8.32) needs to be downloaded from the
184 <link url="http://www.pcre.org">PCRE</link> site and extracted.
185 The rest is done by nginx’s <command>./configure</command> and
186 <command>make</command>.
187 The library is required for regular expressions support in the
188 <link doc="http/ngx_http_core_module.xml" id="location"/> directive
189 and for the
190 <link doc="http/ngx_http_rewrite_module.xml">ngx_http_rewrite_module</link>
191 module.
192 </para>
193 </listitem>
194
195 <listitem>
196 <para>
197 <literal>--with-pcre-jit</literal>&mdash;builds the PCRE library with
198 “just-in-time compilation” support (1.1.12, the
199 <link doc="ngx_core_module.xml" id="pcre_jit"/> directive).
200 </para>
201 </listitem>
202
203 <listitem>
204 <para>
205 <literal>--with-zlib=<value>path</value></literal>&mdash;sets
206 the path to the sources of the zlib library.
207 The library distribution (version
208 1.1.3&mdash;1.2.7) needs to be downloaded from the
209 <link url="http://zlib.net">zlib</link> site and extracted.
210 The rest is done by nginx’s <command>./configure</command> and
211 <command>make</command>.
212 The library is required for the
213 <link doc="http/ngx_http_gzip_module.xml">ngx_http_gzip_module</link> module.
214 </para>
215 </listitem>
216
217 <listitem>
218 <para>
219 <literal>--with-cc-opt=<value>parameters</value></literal>&mdash;sets
220 additional parameters that will be added to the CFLAGS variable.
221 When using the system PCRE library under FreeBSD,
222 <literal>--with-cc-opt="-I /usr/local/include"</literal>
223 should be specified.
224 If the number of files supported by <c-func>select</c-func> needs to be
225 increased it can also be specified here such as this:
226 <literal>--with-cc-opt="-D FD_SETSIZE=2048"</literal>.
227 </para>
228 </listitem>
229
230 <listitem>
231 <para>
232 <literal>--with-ld-opt=<value>parameters</value></literal>&mdash;sets
233 additional parameters that will be used during linking.
234 When using the system PCRE library under FreeBSD,
235 <literal>--with-ld-opt="-L /usr/local/lib"</literal>
236 should be specified.
237 </para>
238 </listitem>
239
240 </list>
241
242 </para>
243
244 <para>
245 Example of parameters usage (all of this needs to be typed in one line):
246 <programlisting>
247 ./configure
248 --sbin-path=/usr/local/nginx/nginx
249 --conf-path=/usr/local/nginx/nginx.conf
250 --pid-path=/usr/local/nginx/nginx.pid
251 --with-http_ssl_module
252 --with-pcre=../pcre-4.4
253 --with-zlib=../zlib-1.1.3
254 </programlisting>
255 </para>
256
257 <para>
258 After configuration,
259 nginx is compiled and installed using <command>make</command>.
260 </para>
261
262 </section>
263
264 </article>