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

  • 相关阅读:
    字符串样式效果
    javaScript 继承原型链
    javaScript 的继承,call()
    二维数组中的查找
    如何证明一个映射是混沌的。
    netty如何知道连接已经关闭,socket心跳,双工?异步?
    java中线程安全的map是ConcurrentHashMap
    failed to load class "org.sl4j.impl.StaticLoggerBinder"
    Tcp端口以及端口相关协议详解
    Tcp的三次握手,以及原理详解
  • 原文地址:https://www.cnblogs.com/rxbook/p/5993261.html
Copyright © 2011-2022 走看看