nginx安装笔记

中间碰到了些问题,就随笔记下了!

安装过程

1.先装 libstdc++5

sudo aptitude install libstdc++5

若是没有装aptitude的话 ,先装这个:sudo apt-get install aptitude

 

2.下载prce 包

wget http://sourceforge.net/projects/pcre/files/pcre/8.30/pcre-8.30.tar.gz/download 下载 出来的一个download,修改下名称

mv download  pcre-8.30.tar.gz

tar -zxvf pcre-8.30.tar.gz

cd pcre-8.30

./configure

make

 

报错:

libtool: compile: unrecognized option `-DHAVE_CONFIG_H’

libtool: compile: Try `libtool –help’ for more information.

make[1]: *** [pcrecpp.lo] Error 1

 

那么安装下g++

sudo aptitude install g++

 

再次重新编译:

./configure

make

sudo make install

 

搞定prce包

 

 

4.下载 libssl-dev

sudo aptitude install   libssl-dev

 

5.下载 libghc-puremd5-dev

sudo aptitude install libghc-puremd5-dev

 

6.终于可以编译nignx了

wget http://nginx.org/download/nginx-1.0.10.tar.gz

tar -zxvf nginx-1.0.10.tar.gz

cd nginx-1.0.10

./configure

make

sudo make install

 

下面这个错误时nginx-0.8.54版本有问题,换成最新的 nginx-1.0.10 就可以!

src/core/ngx_resolver.c: In function ‘ngx_resolver_process_ptr’:

src/core/ngx_resolver.c:1425:43: error: variable ‘qclass’ set but not used [-Werror=unused-but-set-variable]

src/core/ngx_resolver.c:1425:36: error: variable ‘qtype’ set but not used [-Werror=unused-but-set-variable]

cc1: all warnings being treated as errors

make[1]: *** [objs/src/core/ngx_resolver.o] Error 1

 

7.查看下是否正确安装

whereis nginx

nginx: /etc/nginx /usr/local/nginx

配置文件在 /etc/nginx 下

启动命令在 /usr/local/nginx 下

配置下PATH

sudo vim /etc/profile

启动nginx :nginx

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>