System version: centos6.4
Tools: nginx-1.8.1.tar.gz, pcre-8.37.tar.gz
Set up the build environment:
Local Source: yum-y Groupinstall "Development Tools" "Server Platform Development"
Put the tool nginx-1.8.1.tar.gz, pcre-8.37.tar.gz under/root, so
Tar XF pcre-8.37.tar.gz
CD pcre-8.37
./configure--prefix=/usr/local/pcre
Make && make install
Note: Nginx Install the required library: Pcre Library, install Pcre Library is for Nginx support HTTP rewrite module
Then start installing Nginx:
Useradd-m-s/sbin/nologin Nginx
Tar XF nginx-1.8.1.tar.gz
./configure--user-user--group-nginx--prefix=/usr/local/nginx-1.8.1--with-http_stub_status_module--with-http_ Ssl_module--with-pcre=/usr/local/pcre
Make
Note: When the./configure finishes executing make, the following error occurs:
cd/usr/local/pcre/\
&& If [-f Makefile]; then make distclean; fi \
&& cc= "gcc" cflags= "-o2-fomit-frame-pointer-pipe" \
./configure--disable-shared
/bin/sh:line 2:./configure:no such file or directory
make[1]: * * * [/usr/local/pcre//makefile] Error 127
Then view the compiled parameters
./configure--help found the following:
--with-pcre=dir set path to Pcre library sources: set route to Pcre repository source
So change the pcre path again.
./configure--user-user--group-nginx--prefix=/usr/local/nginx-1.8.1--with-http_stub_status_module--with-http_ Ssl_module--with-pcre=/root/pcre-8.37
Make
Make install
This compiles the nginx to complete
Ln-s/USR/LOCAL/NGINX-1.8.1//usr/local/nginx
[Email protected] nginx-1.8.1]#/usr/local/nginx/sbin/nginx-t
Nginx:the configuration file/usr/local/nginx-1.8.1/conf/nginx.conf syntax is OK
Nginx:configuration file/usr/local/nginx-1.8.1/conf/nginx.conf Test is successful
Compile and install Nginx