Building nginx from Sources(从源代码安装nginx)

Building nginx from Sources(从源代码安装nginx)

The build is configured using the configure command.  安装用配置命令

It defines various aspects of the system, including the methods nginx is allowed to use for connection processing. At the end it creates a Makefile.

它定了了各种系统,包括nginx方法被允许使用连接的过程。在最后创建了”文件编写“文件

The configure command supports the following parameters: 配置命令支持下边的一些参数

--prefix=path — defines a directory that will keep server files. 前缀路径,定义了一个保存服务器文件的目录

 

This same directory will also be used for all relative paths set by configure (except for paths to libraries sources) 同样的目录将设置为相同目录,如果直接执行configure命令

 

and in the nginx.conf configuration file. It is set to the /usr/local/nginx directory by default.  默认使用configure命令,最终保存服务器文件的目录在 /usr/local/nginx目录里面,该默认目录的设置是在nginx.conf里面设置的

 

 

 

 

--sbin-path=path — sets the name of an nginx executable file. This name is used only during installation. By default the file is named prefix/sbin/nginx.

sbin-path 等于一个路径,该路径是设置一个可行执行文件的名字,这个名字仅仅用于安装。默认该文件被命名为 prefix/sbin/nginx.

 

--conf-path=path — sets the name of an nginx.conf configuration file. If needs be, nginx can always be started with a different configuration file, by specifying it in the command-line parameter

-c file. By default the file is named prefix/conf/nginx.conf.

conf-path等于一个路径,设置nginx.conf这个配置文件的名称。如果有必须要,nginx可以用不同的配置文件开始。特别的命令配置文件的命令行参数为 -c file.默认文件命名为 prefix/conf/nginx.conf

 

--pid-path=path — sets the name of an nginx.pid file that will store the process ID of the main process. After installation, the file name can always be changed in the nginx.conf configuration file using the pid directive. By default the file is named prefix/logs/nginx.pid

pid-path等于一个路径,该路径是nginx.pid文件,用于存储主进程中的一个进程ID.在安装后,这个文件名称通常被改为nginx.conf备至文件被使用pid指令。默认文件被命名为 prefix/logs/nginx.pid

 

--error-log-path=path — sets the name of the primary error, warnings, and diagnostic file. After installation, the file name can always be changed in the nginx.conf configuration file using the error_log directive. By default the file is named prefix/logs/error.log.

errror-log-path等于一个路径,该路径是参数错误、警告、诊断文件。在安装后,该文件通常被修改到nginx.conf备至文件用error log指令,默认文件被命名为 prefix/logs/error.log

 

 

--http-log-path=path — sets the name of the primary request log file of the HTTP server. After installation, the file name can always be changed in the nginx.conf configuration file using the access_log directive. By default the file is named prefix/logs/access.log.

--http-log-path等于一个路径,该路径设置了http服务器的请求逻辑日志参数的名称。在安装后,该名称被改进进入nginx.conf配置文件用 通过逻辑 指令。默认该文件被命名为 prefix/logs/access.log

 

--user=name — sets the name of an unprivileged user whose credentials will be used by worker processes. After installation, the name can always be changed in the nginx.conf configuration file using the user directive. The default user name is nobody.

 

--user等于一个路径,该路径是一个能够被用着工作进程的资格证书的特权用户。在安装后,该名称被改进进入nginx.confi文件,被命名为user指令。默认用户为没有任何人

 

--group=name — sets the name of a group whose credentials will be used by worker processes. After installation, the name can always be changed in the nginx.conf configuration file using the user directive. By default, a group name is set to the name of an unprivileged user.

--group等于一个名称,具有工作进程资格证书的一组名称。这个名称通常被改进进入nginx.conf以user指令。默认一组指令被设置到特权用户

 

--with-select_module
--without-select_module — enables or disables building a module that allows the server to work with the select() method. This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, or /dev/poll.

--without-select_module:是一个允许或者禁用一个模块,该模块允许服务器用select()方法工作。这个模块被自动建立当平台没有出现适合的方法如kqueue, epoll, or /dev/poll

 

--with-poll_module
--without-poll_module — enables or disables building a module that allows the server to work with the poll() method. This module is built automatically if the platform does not appear to support more appropriate methods such as kqueue, epoll, or /dev/poll.

--without-poll_module:允许或者禁用一个建立的模块,该模块允许服务器用poll()线程方法工作。该模块被自动建立当服务器没有出现荀彧合适的方法,例如kqueue,epoll,or /dev/poll

 

--without-http_gzip_module — disables building a module that compresses responses of an HTTP server. The zlib library is required to build and run this module.

--without-http_gzip_module:禁用http服务的解压缩创建模块。这个zlib图书馆被允许建立运行该模块

 

--without-http_rewrite_module — disables building a module that allows an HTTP server to redirect requests and change URI of requests. The PCRE library is required to build and run this module.  禁用http服务器http服务器转发请求或者改变请求的URL创建的模块。 这个PCRE这个图书馆被允许建立和运行该模块

 

--without-http_proxy_module — disables building an HTTP server proxying module.

--without-http_proxy_module  禁止http服务器代理模块

 

--with-http_ssl_module — enables building a module that adds the HTTPS protocol support to an HTTP server. This module is not built by default. The OpenSSL library is required to build and run this module.

--with-http_ssl_module:允许建立一个http服务器的http协议支持的模块。该模块默认不会被建立。 开源库被建立和运行该模块

 

--with-pcre=path — sets the path to the sources of the PCRE library. The library distribution (version 4.4 — 8.39) needs to be downloaded from the PCRE site and extracted. The rest is done by nginx’s ./configure and make. The library is required for regular expressions support in the location directive and for the ngx_http_rewrite_module module.

--with-pcre等于一个路径,该路径是一个网络库的资源。这个库需要下载从网络库和提取。剩下的被nginx的配置文件创建。这个库被要求为当前命令或者重写模块的库命令

 

--with-pcre-jit — builds the PCRE library with “just-in-time compilation” support (1.1.12, the pcre_jit directive).

--with-pcre-jit建立了PCRE库带着及时编译帮助

 

--with-zlib=path — sets the path to the sources of the zlib library. The library distribution (version 1.1.3 — 1.2.8) needs to be downloaded from the zlib site and extracted. The rest is done by nginx’s ./configure and make. The library is required for the ngx_http_gzip_module module.

--with-zlib等于一个路径,设置了zlib库的源代码路径。这个库贡献需要从zlib站点下站和提取。剩下的被做到nginx的配置文件和编译。这个库被http解压缩模块所需要

 

--with-cc-opt=parameters — sets additional parameters that will be added to the CFLAGS variable. When using the system PCRE library under FreeBSD, --with-cc-opt="-I /usr/local/include" should be specified. If the number of files supported by select() needs to be increased it can also be specified here such as this: --with-cc-opt="-D FD_SETSIZE=2048".

--with-cc-opt等于参数,设置附加的参数被添加到目的变量。当使用系统PCRE库在免费的BSD下时候,用--with-cc-opt="-I /usr/lcoal/include"应该被设定。如果文件的大小需要支持选择方法,他被特定指示为这样的形式:--with-c-opt="-D FD_SETSIZE=2048"

 

--with-ld-opt=parameters — sets additional parameters that will be used during linking. When using the system PCRE library under FreeBSD, --with-ld-opt="-L /usr/local/lib" should be specified.

--with-ld-opt=parameters:设定附加的参数,这些常被用到连接。当我们在UNIX操作系统下使用PCRE库时候,被指定为"--with-ld-opt="-L /usr/local/lib""

 

 

Example of parameters usage (all of this needs to be typed in one line): 被使用的参数的例子(所有的需求类型是一行)

./configure
    --sbin-path=/usr/local/nginx/nginx
    --conf-path=/usr/local/nginx/nginx.conf
    --pid-path=/usr/local/nginx/nginx.pid
    --with-http_ssl_module
    --with-pcre=../pcre-8.39
    --with-zlib=../zlib-1.2.8

 

 After configuration, nginx is compiled and installed using make.

在配置之后,nginx被编译和用make安装

 

posted @ 2016-09-12 15:00  刘小草  阅读(304)  评论(0编辑  收藏  举报