在用源码安装nginx,make时出现如下:
make: *** No rule to make target 'build', needed by 'default'. Stop.
这个的原因是缺少依赖库,在执行./configure时你应该在最下面可以看到下面字样:
./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.
这里很明显的提示error,缺少 PCRE 库,提示你可以安装或 禁用这个模块。
一般安装nginx都需要三个依赖库:pcre,zlib,openssl。安装好就行了,跟nginx一样,下载这三个库的源码包下来编译安装。
乌班图的包名不太一样,使用以下命令安装,分别对应三个包,可以一起安装,其中openssl不是必须
sudo apt-get install libpcre3-dev
sudo apt-get install zlib1g zlib1g.dev
sudo apt-get install openssl