码迷,mamicode.com
首页 > 其他好文 > 详细

nginx安装配置记录

时间:2015-01-31 21:53:26      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:

文章出处:http://blog.csdn.net/lili72

环境cenos5.9 安装在192.168.119.131上进行.安装路径统一为/home/bigdata/

 

安装之前需要先安装:

   1.1 openssl

   1.1.1 下载 ,cd /home/bigdata/   wget  http://www.openssl.org/source/openssl-1.0.0a.tar.gz

       解压:   tar  -xvf  openssl-1.0.0a.tar.gz

                mv  openssl-1.0.0   openss

                cd  openss

                ./config

./config -t

make depend

make

make test

make install

 

   1.2 pcre

       1.2.1 下载 :http://sourceforge.net/projects/pcre/files/

                   mv    xxx  pcre210

                  ./configure --prefix=/home/bigdata/pcre210

                  make

                  make install

 

      1.2.2 在线安装    yum -y install pcre-devel

 

 

  1.3  zlib-devel

      1.3.1 在线安装  yum install -y zlib-devel

 

 

2 nginx 安装

 

2.1  nginx 下载

 http://nginx.org/en/download.html    

技术分享

 

 

2.2  上传到/home/bigdata/nginx-1.7.9.tar.gz

   解压:  tar -xvf nginx-1.7.9.tar.gz

    注:不要改名称为  nginx

   改名称  mv  nginx-1.7.9  nginx179

   

2.3  安装

 

./configure --prefix=/home/bigdata/nginx --with-pcre=/home/bigdata/pcre210 --with-http_ssl_module --with-openssl=/home/bigdata/openssl

 

make

 

make  install

出现如下错误:

make[2]: Entering directory `/home/bigdata/pcre210‘

make[2]: *** No rule to make target `libpcre.la‘.  Stop.

make[2]: Leaving directory `/home/bigdata/pcre210‘

make[1]: *** [/home/bigdata/pcre210/.libs/libpcre.a] Error 2

make[1]: Leaving directory `/home/bigdata/nginx‘

make: *** [install] Error 2

 

解决方案:

mkdir -p /home/bigdata/pcre210/.libs

cp /usr/lib/libpcre.a /home/bigdata/pcre210/libpcre.a

cp /usr/lib/libpcre.a /home/bigdata/pcre210/libpcre.la

cp /usr/lib/libpcre.a /home/bigdata/pcre210/.libs/libpcre.a

cp /usr/lib/libpcre.a /home/bigdata/pcre210/.libs/libpcre.la

再次安装

make install

出现以下错误:

cp: `conf/koi-win‘ and `/home/bigdata/nginx/conf/koi-win‘ are the same file

make[1]: *** [install] Error 1

make[1]: Leaving directory `/home/bigdata/nginx‘

make: *** [install] Error 2

 

解决方法:以下各需要的组件都是前面对应安装的路径。

./configure --prefix=/home/bigdata/nginx --conf-path=/home/bigdata/nginx/conf/nginx.conf --with-openssl=/home/bigdata/openssl --with-http_ssl_module --with-pcre=/home/bigdata/pcre210 

再次makemake install

 文章出处:http://blog.csdn.net/lili72

启动  nginx  服务

/home/bigdata/nginx/sbin/nginx -c /home/bigdata/nginx/conf/nginx.conf

查看是否启动成功

查看进程: ps -ef | grep nginx  

技术分享

 

 

访问  该台机器的80端口 

http://192.168.119.128:80  

技术分享

 

安装成功.

 

停止nginx

kill -QUIT 21510(主进程号)

 

Nginx 重启

/home/bigdata/nginx/sbin/nginx  -s  reload

 

Nginx的配置说明可以参考文章:

http://www.cnblogs.com/xiaogangqq123/archive/2011/03/02/1969006.html

 

 


nginx安装配置记录

标签:

原文地址:http://blog.csdn.net/lili72/article/details/43346655

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!