windows 下 nginx+tomcat 负载均衡配置
一、nginx 安装
由于 nginx 在 linux 下安装有些复杂,这里单独拿出来作下记录。
下载 nginx-0.8.54.tar.gz,解压并编译安装 tar –zxvf nginx-0.8.54.tar.gz
进入相关目录,运行
./congure
make
sudo make install
你要运气好的话,一切 ok,不过相信没有人运气好的,哈哈。Linux 有些版本默认的策略
是什么库都不装,依赖的库都需要自已手工安装搞定。一般都会出错的,那么我们来看看
可能出现的问题。
常见问题解决
1、缺少 gcc-c++和 libtool,也就是 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
guangbo@guangbo-laptop:~/work/pcre-8.12$ libtool -help -DHAVE_CONFIG_H
The program 'libtool' is currently not installed. You can install it by typing:
sudo apt-get install libtool
guangbo@guangbo-laptop:~/work/pcre-8.12$
解决方法:需要先安装 libtool 和 gcc-c++
2、缺少 pcre library
./congure: 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-8.12 解决问题,解压后对 pcre 进行如下操作
官网:http://www.pcre.org/
下载页面:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
第 3 页 共 12 页
评论0