yum-y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
2 安装 PCRE
1 2 3 4 5
wgethttp://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz tarzxvf pcre-8.35.tar.gz cdpcre-8.35 ./configure make&& make install
若没有安装则在安装可能出现如下错误
若出现缺少依赖包则先安装依赖包,以下纯净centos mini版碰到的两个依赖包问题
1
./configure: error: the HTTP rewrite modulerequires the PCRE library. You can either disable the module by using --withou-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
出现上面这个执行 yum -y install pcre-devel 安装依赖,
1
./configure: error: the HTTP gzip modulerequires the zlib library. You can either disable the module by using --withou-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
出现这个yum install -y zlib-devel 安装依赖,
3 安装nginx
1 2 3 4 5 6 7 8
##获取nginx最新的安装包 wget http://nginx.org/download/nginx-1.11.10.tar.gz ##解压缩 tar zxvf nginx-1.11.10.tar.gz ##进入目录 cd nginx-1.11.10 ##检测系统配置, 生成make相关文件 ./configure --prefix=/usr/local/nginx ## --prefix 指定安装目录