1.安装nginx执行./configure...会在最后报以下几种错误,之后执行make就会报:make: *** No rule to make
target `build', needed by `default'. Stop.错误。

注:个人经历,错误1、2、3可能会逐个出现,所以出现那个就解决那个吧。我把第三个处理了才ok的。

错误列表:

(1)

./configure: error: the HTTP <http://www.169it.com/tag/http> rewrite
<http://www.169it.com/tag/rewrite> module <http://www.169it.com/tag/module> 
requires <http://www.169it.com/tag/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.

(2)

./configure: error: the HTTP cache <http://www.169it.com/tag/cache> module
requires md5 <http://www.169it.com/tag/md5> functions
<http://www.169it.com/tag/functions>

from OpenSSL library.  You can either disable the module by using

--without-http-cache option, or install the OpenSSL library into the system,

or build the OpenSSL library statically from the source with nginx by using

--with-http_ssl_module --with-openssl=<path> options
<http://www.169it.com/tag/options>.

(3)   

./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 

网上解决办法:

需要安装openssl以及ncurses组件

yum install -y openssl*

yum -y install ncurses-devel

2.但执行以上操作依然不行:

经过一番折腾~发现在执行.configure时就报了很多错误:上述错误,因此需要逐个解决!

解决办法:

出现(1)错误:

需要安装pcre包:

下载地址:https://ftp.pcre.org/pub/pcre/ <https://ftp.pcre.org/pub/pcre/>

tar <http://www.169it.com/tag/tar> zxvf pcre-8.12.tar.gz
<http://www.169it.com/tag/gz>

cd <http://www.169it.com/tag/cd> pcre-8.12

./configure

make

make install

出现(2)错误:

需要安装openssl

下载地址:http://gnuwin32.sourceforge.net/packages/openssl.htm
<http://gnuwin32.sourceforge.net/packages/openssl.htm>

tar zxvf openssl-0.9 <http://www.169it.com/tag/.9>.8h.tar.gz

cd openssl-0.9.8h

./config --prefix <http://www.169it.com/tag/prefix>=/usr/local/
--openssldir=/usr/local/openssl -g3 shared <http://www.169it.com/tag/shared>
 zlib-dynamic <http://www.169it.com/tag/dynamic> enable-camellia
<http://www.169it.com/tag/camellia>

make

make install

测试 <http://www.169it.com/tag/%E6%B5%8B%E8%AF%95>是否安装成功:openssl version
<http://www.169it.com/tag/version>

出现(3)错误:

需要安装zlib包:

下载地址:http://www.zlib.net/ <http://www.zlib.net/>

tar <http://www.169it.com/tag/tar> zxvf zlib-1.2.11.tar.gz

cd <http://www.169it.com/tag/cd> zlib-1.2.11

./configure

make

make install