How to install nginx in Linux

Source: Internet
Author: User
Refer to this article to learn: Workshop .. For everyone to be familiar .. Nginx is commonly used in Unix./configure & amp; make & amp; makeinstall

See this article to learn: html "> http://www.2cto.com/ OS /201012/80611.html

Now many servers are starting to use Nginx... this is also an installation method in Linux .. For everyone to be familiar ..

Nginx uses the./configure & make install processes commonly used in Unix to compile and install Nginx.

The configure script determines some features of the system, especially the nginx method for handling connections. Then, it creates the Makefile file.

 

Configure supports the following options:

-- Prefix = -Nginx installation path. If not specified, the default value is/usr/local/nginx.

-- Sbin-path = -Installation path of the Nginx executable file. It can only be specified during installation. if it is not specified, the default value is /Sbin/nginx.

-- Conf-path = -The default nginx. conf path is not given with the-c option. If not specified, the default value is /Conf/nginx. conf.

-- Pid-path = -If no pid command is specified in nginx. conf, the default nginx. pid path is used. If not specified, the default value is /Logs/nginx. pid.

-- Lock-path = -Nginx. lock file path.

-- Error-log-path = -If the error_log command is not specified in nginx. conf, the default error log path is used. If not specified, the default value is /Logs/error. log.

-- Http-log-path = -If no access_log command is specified in nginx. conf, the default access log path is used. If not specified, the default value is /Logs/access. log.

-- User = -If no user command is specified in nginx. conf, the default nginx user is used. If not specified, the default value is nobody.

-- Group = -If no user command is specified in nginx. conf, the default group used by nginx is used. If not specified, the default value is nobody.

-- Builddir = DIR-specify the compiled Directory

-- With-rtsig_module-enables the rtsig module

-- With-select_module -- without-select_module-Whether or not to enable the select module. this module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or/dev/poll is not discovered by configure.

// SELECT mode is allowed or not allowed. if configure does not find a more suitable mode, such as kqueue (sun OS), epoll (linux kenel 2.6 +), rtsig (real-time signal) OR/dev/poll (a select-like mode. the underlying implementation is basically the same as that of SELECT, and the round training method is used) SELECT mode will be the default installation mode -- with-poll_module -- without-poll_module-Whether or not to enable the poll module. this module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or/dev/poll is not discovered by configure.

 

-- With-http_ssl_module-Enable ngx_http_ssl_module. Enables SSL support and the ability to handle HTTPS requests. Requires OpenSSL. On Debian, this is libssl-dev.

// Enable the http ssl module so that NGINX can support HTTPS requests. OPENSSL must be installed in this module, which is libssl on DEBIAN.

-- With-http_realip_module-enable ngx_http_realip_module

-- With-http_addition_module-enable ngx_http_addition_module

-- With-http_sub_module-enable ngx_http_sub_module

-- With-http_dav_module-enable ngx_http_dav_module

-- With-http_flv_module-enable ngx_http_flv_module

-- With-http_stub_status_module-enable the "server status" page

-- Without-http_charset_module-disable ngx_http_charset_module

-- Without-http_gzip_module-disable ngx_http_gzip_module. If enabled, zlib is required.

-- Without-http_ssi_module-disable ngx_http_ssi_module

-- Without-http_userid_module-disable ngx_http_userid_module

-- Without-http_access_module-disable ngx_http_access_module

-- Without-http_auth_basic_module-disable ngx_http_auth_basic_module

-- Without-http_autoindex_module-disable ngx_http_autoindex_module


-- Without-http_geo_module-disable ngx_http_geo_module

-- Without-http_map_module-disable ngx_http_map_module

-- Without-http_referer_module-disable ngx_http_referer_module

-- Without-http_rewrite_module-disable ngx_http_rewrite_module. If enabled, PCRE is required.

-- Without-http_proxy_module-disable ngx_http_proxy_module

-- Without-http_fastcgi_module-disable ngx_http_fastcgi_module

-- Without-http_memcached_module-disable ngx_http_memcached_module

-- Without-http_limit_zone_module-disable ngx_http_limit_zone_module

-- Without-http_empty_gif_module-disable ngx_http_empty_gif_module

-- Without-http_browser_module-disable ngx_http_browser_module

-- Without-http_upstream_ip_hash_module-disable ngx_http_upstream_ip_hash_module

-- With-http_perl_module-enable ngx_http_perl_module

-- With-perl_modules_path = PATH-specifies the PATH of the perl module -- with-perl = PATH-specifies the PATH of the perl execution file

-- Http-log-path = PATH-Set path to the http access log

-- Http-client-body-temp-path = PATH-Set path to the http client request body temporary files

 

-- Http-proxy-temp-path = PATH-Set path to the http proxy temporary files

-- Http-fastcgi-temp-path = PATH-Set path to the http fastcgi temporary files

-- Without-http-disable HTTP server

-- With-mail-enable IMAP4/POP3/SMTP proxy module

-- With-mail_ssl_module-enable ngx_mail_ssl_module

-- With-cc = PATH-specifies the C compiler PATH

-- With-cpp = PATH-specifies the PATH of the C preprocessor

-- With-cc-opt = OPTIONS-Additional parameters which will be added to the variable CFLAGS. with the use of the system library PCRE in FreeBSD, it is necessary to indicate -- with-cc-opt = "-I/usr/local/include ". if we are using select () and it is necessary to increase the number of file descriptors, then this also can be assigned here: -- with-cc-opt = "-D FD_SETSIZE = 2048 ".

-- With-ld-opt = OPTIONS-Additional parameters passed to the linker. with the use of the system library PCRE in FreeBSD, it is necessary to indicate -- with-ld-opt = "-L/usr/local/lib ".

-- With-cpu-opt = CPU-for specific CPU compilation, valid values include: pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64 -- without-pcre-disable the use of the PCRE library. The HTTP rewrite module is also disabled. The regular expression in the "location" configuration command also needs PCRE.

-- With-pcre = DIR-specifies the path of the source code of the PCRE library.

-- With-pcre-opt = OPTIONS-Set additional options for PCRE building.

 

-- With-md5 = DIR-Set path to md5 library sources.

-- With-md5-opt = OPTIONS-Set additional options for md5 building.

-- With-md5-asm-Use md5 extends er sources.

-- With-sha1 = DIR-Set path to sha1 library sources.

-- With-sha1-opt = OPTIONS-Set additional options for sha1 building.

-- With-sha1-asm-Use sha1 extends er sources.

-- With-zlib = DIR-Set path to zlib library sources.

-- With-zlib-opt = OPTIONS-Set additional options for zlib building.

-- With-zlib-asm = CPU-Use zlib using er sources optimized for specified CPU, valid values are: pentium, pentiumpro

-- With-openssl = DIR-Set path to OpenSSL library sources

-- With-openssl-opt = OPTIONS

Set additional options for OpenSSL building


-- With-debug-enable debugging logs

-- Add-module = PATH-Add in a third-party module found in directory PATH

In different versions, the options may change slightly. always use the./configure -- help command to check the current list of options. Example (preferably in the same row ):


./Configure
-- Sbin-path =/usr/local/nginx
-- Conf-path =/usr/local/nginx. conf


-- Pid-path =/usr/local/nginx. pid
With-http_ssl_module
-- With-pcre = ../pcre-4.4
-- With-zlib = ../zlib-1.1.3


Example on Ubuntu/debian with libgcrypt11-dev, libpcre3-dev and libssl-dev installed (choose EITHER -- with-md5 OR -- with-sha1, but not both; on debian and ubuntu, they shoshould both point to/usr/lib)

./Configure -- with-openssl =/usr/lib/ssl/-- with-md5 =/usr/lib

An Ubuntu Edgy. deb for version 0.5.2 can be found here: nginx_0.5.2-1_i386.deb.

(NOTE: According to an October 2006 message md5 was used in a now broken http cache module and sha1 is used in an incomplete mysql library module and so are currently not needed .)

Everyone is familiar with it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.