First step: Download Nginx under CentOS
wget http://nginx.org/download/nginx-1.2.9.tar.gz
Unzip the tar zxf nginx-1.2.9.tar.gz
Part II: Create a new user Nginx in the installation operation
Useradd Nginx
passwd Nginx
--nginx Nginx
Step three, unzip and test the installation environment./configure--prefix=/var/nginx (installed in the customer's/nginx_instal embarrassed. )
Error during installation
Checking for OS
+ Linux 2.6.32-220.el6.x86_64 x86_64
Checking for C compiler ... not found
./configure:error:c compiler gcc is not found
Workaround: Install GCC
Yum Install gcc
./configure:error:the HTTP Rewrite module requires the PCRE library.
You 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=<path> option.
Need to install
Install Pcre-devel To resolve the problem (root user installation)
Yum-y Install Pcre-devel
Continue to report Errors
./configure:error:the HTTP gzip module requires the Zlib library.
You 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=<path> option.
Need to install Yum install-y zlib-devel
Continue execution ./configure--prefix=/opt/nginx Installation compilation succeeded
Fourth Step:
Make && make install
Fifth Step:
Cd/opt/nginx/sin
./nginx
Then open the browser input IP address display
Welcome to nginx!
Xxxxxxxxx
Installation Successful
Original address: http://www.itmmd.com/201410/73.html
The article is published by the Android Development and distribution, reproduced must be marked by the source. .
CENTOS6 installation Nginx The most detailed steps to cover the missing library complete solution