This section describes how to compile and install the GCC compiling environment before you start the installation. It can be used in Ubuntu.
Apt-Get install build-essential
Apt-Get install libtool
1. The source code downloaded from the internet is stored in/Urs/local/src. 2. decompress the package and install it in/usr/local. 3. Install 1. Install zlib1g-dev and libpcre3-dev
Apt-Get install zlib1g-devlibpcre3-dev-y
2. Install PCRE
Wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.gz
Tar-xzf pcre-8.21.tar.gz
./Configure
Make
Make install
3. Install OpenSSL
WgetHttp://www.openssl.org/source/openssl-0.0.1c.tar.gz
./Config
Make
Make install
4. Install zlib
Wget http://www.zlib.net/zlib-1.2.8.tar.gz
./Configure
Make
Make install
5. Download nginx and compile and install nginx (1) execute the following compilation settings
./Configure -- prefix =/usr/local/nginx-1.2.3 \
-- Conf-Path =/usr/local/nginx-1.2.3/nginx. conf \
-- OpenSSL-Path =/usr/local/openssl-1.0.1c \
With-http_ssl_module \
-- With-PCRE =/usr/local/pcre-8.21 \
-- With-http-stub-status-Module
(Note: conf-path is not set for many compilation and installation instructions, but if I have not set it, it will appear in the make install stage.
CP: 'conf/Koi-win' and '/usr/local/nginx/CONF/Koi-win' are the same file error)
(2) Make (3) make install
Compilation parameter description:
-
-- Prefix =Path-
Nginx installation path. If not specified, the default value is/usr/local/nginx.
-
-- Sbin-Path =Path-
Nginx Executable File Installation path. It can only be specified during installation. If it is not specified, the default value is <prefix>/sbin/nginx.
-
-- Conf-Path =Path -
The default nginx. conf path is not given with the-C option. If not specified, the default value is <prefix>/CONF/nginx. conf.
-
-- PID-Path =Path -
Specify the nginx. PID file name. After installation, the name can be modified in the nginx. Cong file. If not specified, the default value is <prefix>/logs/nginx. PID.
-
-- Error-log-Path =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 <prefix>/logs/error. log.
-
-- User =Name-
If no USER command is specified in nginx. conf, the default nginx user is used. If not specified, the default value is nobody.
-
-- Group =Name-
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.
-
With-http_ssl_module-
Enable the http ssl module so that nginx can support HTTPS requests. OpenSSL must be installed for this module.
-
-- With-PCRE =Path-
Specifies the path of the PCRE Library. (PCRE is the Regular Expression Library)
-
-- With-PCRE-jit-Builds the PCRE Library with "just-in-time compilation" support.