您的位置:首页 > 运维架构 > Nginx

nginx 安装

2015-12-28 14:34 531 查看
下载nginx(nginx-1.2.9.tar.g) openssl-1.0.2e.tar.gz ,zlib-1.2.8.tar.gz, pcre(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
问题:

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的时候一直出现这个问题,后换成低版本就可以
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: