下载nginx(nginx-1.2.9.tar.g) openssl-1.0.2e.tar.gz ,zlib-1.2.8.tar.gz
, p
cre(pcre-8.31.tar.gz)
安装openssl-1.0.2e.tar.gz ,zlib-1.2.8.tar.gz
安装前 在线安装gcc、openssl-devel、pcre-devel、zlib-devel
#yum -y install gcc openssl-devel pcre-devel zlib-devel
安装pcre
#tar zxvf pcre-8.31.tar.gz
#cd pcre-8.31
#./congigure
#make
#make install
#cd pcre-8.31
#./congigure
#make
#make install
问题:
libtool: compile: unrecognized option `-DHAVE_CONFIG_H'
libtool: compile: Try `libtool --help' for more information.
make[1]: *** [pcrecpp.lo] Error 1
make[1]: Leaving directory `/home/guangbo/work/pcre-8.12'
make: *** [all] Error 2
缺少gcc-c++和libtool,也就是c++编译包
解决方法:需要先安装libtool和gcc-c++
#yum -y install libtool
#yum -y install gcc-c++
libtool: compile: unrecognized option `-DHAVE_CONFIG_H'
libtool: compile: Try `libtool --help' for more information.
make[1]: *** [pcrecpp.lo] Error 1
make[1]: Leaving directory `/home/guangbo/work/pcre-8.12'
make: *** [all] Error 2
缺少gcc-c++和libtool,也就是c++编译包
解决方法:需要先安装libtool和gcc-c++
#yum -y install libtool
#yum -y install gcc-c++
之后重新配置,编译,安装
./configure --prefix=/usr/local/nginx(安装目录不能和加压目录放在一起) --with-http_realip_module --with-http_sub_module --with-http_flv_module --with-http_dav_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_addition_module --with-pcre=/usr/local/pcre-8.31 --with-openssl=/usr/local/openssl-1.0.2e --with-zlib=/usr/local/zlib-1.2.8
启动:
/usr/local/nginx/sbin/nginx
重启:
/usr/local/nginx/sbin/nginx
-s reload
问题:
make[1]: *** [objs/nginx] Error 1
当用高版本pcre和nginx的时候一直出现这个问题,后换成低版本就可以