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

nginx安装

时间:2014-10-28 18:05:25      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:nginx

1、安装pcre
    下载地址:     [root@lw-01 ~] # cd pcre-8.36
     [root@lw-01 pcre-8.36] #./configure --prefix=/usr/local/pcre
2、安装OpenSSL
    下载地址:    [root@lw-01 ~]# # cd openssl-1.0.2-beta3
    [root@lw-01 openssl-1.0.2-beta3] #./config --prefix=/usr/local --openssldir=/usr/local/openssl
    [root@lw-01 openssl-1.0.2-beta3] #make && make install
   安装失败的话,读一下INSTALL文档,使用 make clean清理重新安装。
3、安装nginx
    下载地址:   
    [root@lw-01 ~]## cd nginx-1.7.6
    [root@lw-01 nginx-1.7.6]# ./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre --with-openssl=/usr/local/openssl --with-http_stub_status_module
    (如果编译失败,修改--with-prce=/opt/pcre-8.36      --with-openssl=/opt/openssl-1.0.2-beta3)
    其中参数 --with-http_stub_status_module 是为了启用 nginx 的 NginxStatus 功能,用来监控 Nginx 的当前状态。

4、启动

    #/usr/local/nginx/sbin/nginx

   

补充:nginx启动报错,信息如下:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

.....

使用ps ef|grep nginx,并未发现有nginx进程,有可能被其他进程占用,这时可以采用如下方式处理:

1. 查看80端口占用

   netstat -ntpl

2.查看当前连接主机

 netstat -n | grep 80

nginx安装

标签:nginx

原文地址:http://pynliu.blog.51cto.com/5027391/1568923

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