Download a nginx tar.gz version from the official website.
Installation using Make installation
The first step: decompression
TAR-ZXVF nginx-1.7.4.tar.gz
Step Two: Enter nginx-1.7.4, execute./configure command
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------
[Root@localhost nginx-1.7.4]#./configure
Checking for OS
+ Linux 2.6.32-431.el6.x86_64 x86_64
Checking for C compiler ... not found
./configure:error:c compiler cc is not found
This error occurs.
Then the GCC package is not installed. Install GCC Bar, the year of Sao.
Yum-y Install GCC
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------
Execute again./configure
./configure:error:the HTTP Rewrite module requires the PCRE library.
Can either disable the module by using--without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
Statically from the source with Nginx by using--with-pcre= option.
Yum Install Pcre-devel
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------
Execute again./configure
./configure:error:the HTTP gzip module requires the Zlib library.
Can either disable the module by using--without-http_gzip_module
option, or install the Zlib library into the system, or build the Zlib library
Statically from the source with Nginx by using--with-zlib= option.
Yum Install Zlib-devel
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------
Execute again./configure
Configuration Summary
+ Using System PCRE Library
+ OpenSSL Library is not used
+ Using BUILTIN MD5 code
+ SHA1 Library is not found
+ Using System zlib Library
OK, now you can execute make. If you want to use the OpenSSL function, SHA1 function. Then install OpenSSL, SHA1 bar, Sao year. Install Opensslyum install OpenSSL openssl-devel installation SHA1
Yum Install perl-digest-sha1.x86_64
Open SSL module execution./configure--with-http_ssl_module
Enable the "Server+status" page to execute./configure--with-http_stub_status_module
All two start, I don't need to say. Execute./configure--with-http_stub_status_module--with-http_ssl_module
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------
Then the configre is passed.
--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------
Execute make command
Execute make Install command
So far, Nginx executed successfully.
--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- ------
Down to configure environment variables add in/etc/profile: Export Nginx_home=/usr/local/nginx
Export path= $PATH: $NGINX _home/sbin Save, execute source/etc/profile, make the configuration file effective. Execute nginx-v, you can see the version, indicating that Nginx installation was successful