安裝
tar -zxvf nginx-1.12.1
- 配置(採用的都是默認配置,詳細配置可查詢nginx官網)
./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.
缺乏pcre包,安裝pcre包 yum -y install pcre-devel
再次執行nginx配置 ./configure
執行完後再次報錯以下 ./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.
缺乏zlib包,安裝zlib包 yum -y install zlib zlib-devel
再次執行nginx配置 ./configure --with-http_ssl_module
執行完後報錯 ./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
缺乏OpenSSL包,安裝該包 yum -y install openssl openssl-devel
再次執行nginx配置 ./configure --with-http_ssl_module
再也不報錯,執行成功
make