在新的伺服器安裝nginx,在make編譯時報錯:
make: *** No rule to make target `build', needed by `default'. Stop.
錯誤重制
進入nginx的目錄,先編譯參數:
./configure \
--prefix=/usr/local/nginx \
--pid-path=/usr/local/nginx/run \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-pcre \
--with-http_image_filter_module \
--with-debug \
然後 make
報錯如下:

百度上說是要安裝前置依賴,像gcc ,openssl等,但是我make之前已經安裝了這些依賴。
我的解決方式:
更新yum
yum update
更新完成後,先删除之前準備make的nginx包,然後重新解壓一個。
安裝前置庫:
[[email protected] local]# yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd-devel
進入nginx目錄重新編譯一次參數:
./configure \
--prefix=/usr/local/nginx \
--pid-path=/usr/local/nginx/run \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-pcre \
--with-http_image_filter_module \
--with-debug \
再次 make && make install
成功了。