zoukankan      html  css  js  c++  java
  • nginx介绍及编译安装

    centos平台 nginx 的安装:

     1. 安装make: 

    yum -y install gcc automake autoconf libtool make

     2. 安装g++:

      yum install gcc gcc-c++

     3. nginx依赖于pcre库,要先安装pcre

    yum install pcre pcre-devel
    4. 选定安装目录:
      cd /usr/local/src
      wget http://nginx.org/download/nginx-1.15.0.tar.gz
      tar zxvf nginx-1.15.0.tar.gz
      

      cd nginx-1.15.0

      ./configure

      如果出现./configure: error: the HTTP gzip module requires the zlib library.需要安装zlib

      wget http://zlib.net/zlib-1.2.11.tar.gz
     如果出现

      

      需要安装

      openssl-devel
      yum -y install openssl openssl-devel
      最后执行成功后

      make && make install

    cd /ulsr/local/nginx, 看到如下4个目录

    ./

     ....conf 配置文件 

     ... html 网页文件

     ...logs  日志文件

     ...sbin  主要二进制程序

    centos平台 nginx 的启动:

      1. ./sbin/nginx 

      2. nginx -c 指定配置文件启动

    如果出现端口占用使用netstat -antp检查。

    启动后:

      

    主进程: 管理子work

     ......

    信号量控制nginx

      Kill -信号选项 nginx的主进程号 

    TERM, INT

    Quick shutdown

    QUIT

    Graceful shutdown  优雅的关闭进程,即等请求结束后再关闭

    HUP

    Configuration reload ,Start the new worker processes with

     a new configuration Gracefully shutdown the old worker processes

    改变配置文件,平滑的重读配置文件

    USR1

    Reopen the log files 重读日志,在日志按月/日分割时有用

    USR2

    Upgrade Executable on the fly 平滑的升级

    WINCH

    Gracefully shutdown the worker processes 优雅关闭旧的进程(配合USR2来进行升级)













     
  • 相关阅读:
    GNU风格 汇编语法总结(转)
    CPSR和SPSR(转)
    C语言调用汇编实现字符串对换
    ubuntu如何跑arm程序
    Shell编程之函数调用
    arm汇编--ubuntu12.04 安装arm-linux交叉编译环境
    linux关于bashrc与profile的区别(转)
    Shell如何传递字符串
    打印指针指向的地址值
    在CentOS 6.4中支持exfat格式的U盘
  • 原文地址:https://www.cnblogs.com/gcm688/p/11163782.html
Copyright © 2011-2022 走看看