zoukankan      html  css  js  c++  java
  • LNMP搭建02 -- 编译安装Nginx

    【编译安装Nginx】  

     为了顺利安装Nginx,先安装下面这些:



    【CentOS 编译 nginx 前要做的事情】
    yum install gcc gcc-c++ kernel-devel
    yum -y install pcre-devel openssl openssl-devel



    【Ubuntu 编译 nginx 前要做的事情】

    apt-get install gcc

    apt-get install libpcre3 libpcre3-dev

    apt-get install zlib1g zlib1g-dev

    apt-get install openssl openssl-dev

    sudo apt-get install libcurl3-openssl-dev 

    解压 nginx-1.7.4.tar.gz ,然后进入目录,开始编译。

    命令:

    sudo ./configure --prefix=/usr/local/nginx --with-http_stub_status_module

    编译完的界面:

    这个过程可能出现的错误:

    ./configure: error: the HTTP cache module requires md5 functions from OpenSSL library.  You can either disable the module by using --without-http-cache option, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-http_ssl_module --with-openssl=<path> options.  

    解决:

    sudo apt-get install openssl   

    sudo apt-get install libssl-dev   

    然后 make && make install

    使用命令:/usr/local/server/nginx/sbin/nginx 启动Nginx.

    使用命令:/usr/local/server/nginx/sbin/nginx -s reload 重启Nginx.

    使用命令:/usr/local/server/nginx/sbin/nginx -s stop 终止Nginx.

    查看是否已经成功启动nginx

    ps -ef | grep nginx

    或者使用:ps -A | grep -i nginx

  • 相关阅读:
    在Windows .NET平台下使用Memcached
    Windows下配置使用MemCached
    B/S 网站技术选型
    HttpHandler与HttpModule的用处与区别
    TCP长连接与短连接的区别
    页和区 sql server
    聚集索引和非聚集索引的区别
    MicrosoftSQLServer中的锁模式
    我是如何在SQLServer中处理每天四亿三千万记录的
    datetime模块处理时间
  • 原文地址:https://www.cnblogs.com/rxbook/p/5993261.html
Copyright © 2011-2022 走看看