ubuntu10.04 下 nginx1.0.3安装记录

下午回来准备晚上安装下 这个最新版到瞧瞧,忙完后就坐电脑前了,老毛病又犯了,坐着坐着就又睡着了,过了12点就又醒了,做事不能半途而废,虽然已经不能够  “今日事,今日毕” 啦  废话结束。

nginx 在./configure阶段会提示缺少一些库

缺少pcre library

./configure: 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进行如下操作

./configure

make

sudo make install

运气好一次通过,运气不好,make pcre时会出错

我就属于后者

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/xxx/pcre-8.12'

make: *** [all] Error 2

这个问题我找到到解决方法就是  sudo apt-get install libtool    然后回去pcre就可以正常安装了

再次./configure 时提示还缺少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

statically from the source with nginx by using --with-zlib=<path> option.

下载一个安装就可以,官网已经被X,在我们这个站有个下载链接是链接到一个国外一个开源站到下载点,安装没遇到问题

条件都已满足,接下来关注nginx安装过程

./configure  正常

make  出问题了  好像提示就是下面这样,

> > src/event -I src/event/modules -I src/os/unix -I objs \
> > 		-o objs/src/core/ngx_crypt.o \
> > 		src/core/ngx_crypt.c
> > cc1: warnings being treated as errors
> > src/core/ngx_crypt.c: In function Б─≤ngx_crypt_apr1Б─≥:
> > src/core/ngx_crypt.c:76: warning: pointer targets in passing argument 2 of
Б─≤ngx_md5_updateБ─≥ differ in signedness

google了下(先百度了下,结果很瞎)在nginx邮件列表中看到了解决方法,1.0.3版本到一个bug

解决方法不细写了,网址贴出来留念 

http://forum.nginx.org/read.php?2,201470

http://permalink.gmane.org/gmane.comp.web.nginx.english/27068

下一步 sudo make install 没遇到问题

启动nginx到时候遇到了问题,

提示:error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

解决方法,在/lib中创建一个symbol link到/usr/local/lib/libpcre.so.0.1

命令

sudo ln /usr/local/lib/libpcre.so.0.0.1 /lib/
sudo ln /usr/local/lib/libpcre.so.0 /lib/

 

然后启动时发现端口被占了,想起来前两天安装绿apache玩,暂不知如何该默认端口  直接卸了apache

然后启动nginx,

Welcome to nginx!

 

文中很多片段都是从网上copy下到,感觉遇到到问题还挺多到,就集合一下做个备份,省的以后再造轮子


你可能感兴趣的:(nginx,linux,ubuntu)