查看错误日志
./configure --prefix=/usr/local/nginx
缺少pcre,错误信息如下:
/configure: error: the HTTP rewrite module requires the PCRE library.
解决方法:安装pcre
yum -y install pcre pcre-devel
缺少ssl错误,错误信息如下:
./configure: error: the HTTP cache module requires md5 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.
解决方法:安装openssl
yum -y install openssl openssl-devel
缺少编译器,错误信息如下:
./configure: error: C compiler cc is not found
解决方法:安装gcc-c++
yum -y install gcc-c++ autoconf automake
缺少zlib包,错误信息如下:
./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
解决方法:安装zlib
yum install -y zlib-devel
缺少libxml2,错误信息如下:
./configure: error: the HTTP XSLT module requires the libxml2/libxslt
解决方法:
yum -y install libxml2 libxml2-dev
yum -y install libxslt-devel
缺少GD库,错误信息如下:
./configure: error: the HTTP image filter module requires the GD library.
You can either do not enable the module or install the libraries.
解决方法:安装GD库
yum -y install gd-devel
缺少ExtUtils,错误信息如下:
./configure: error: perl module ExtUtils::Embed is required
解决方法:
yum -y install perl-devel perl-ExtUtils-Embed
缺少GeoIP,错误信息如下:
./configure: error: the GeoIP module requires the GeoIP library.
You can either do not enable the module or install the library.
解决方法:
yum -y install GeoIP GeoIP-devel GeoIP-data
检测是否安装成功
cd /usr/local/nginx/sbin
./nginx -t
启动nginx
./nginx
查看端口
netstat -ntlp