zoukankan      html  css  js  c++  java
  • nginx 1.4.7 发送日志到rsyslog

    <pre name="code" class="html">tar -xzf nginx-1.4.7.tar.gz
    # cd nginx-1.4.77
    # ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx 
    --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module 
    --with-pcre=/root/pcre-8.36 --with-http_realip_module 
    
    
    front-end:/root/nginx-1.4.7# patch -p1 </root/nginx_syslog_patch/syslog_1.4.0.patch 
    patching file src/core/ngx_cycle.c
    patching file src/core/ngx_log.c
    patching file src/core/ngx_log.h
    patching file src/http/modules/ngx_http_log_module.c
    patching file src/http/ngx_http_core_module.c
    Hunk #2 succeeded at 4895 (offset 2 lines).
    Hunk #3 succeeded at 4913 (offset 2 lines).
    Hunk #4 succeeded at 4952 (offset 2 lines).
    patching file src/http/ngx_http_request.c
    Hunk #1 succeeded at 517 (offset -14 lines).
    Hunk #2 succeeded at 798 (offset -23 lines).
    Hunk #3 succeeded at 2002 (offset -23 lines).
    front-end:/root/nginx-1.4.7# 
    
    
    重新编译nginx:
    
    ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx 
    --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module 
    --with-pcre=/root/pcre-8.36 --with-http_realip_module --add-module=/root/nginx_syslog_patch/
    
    
    front-end:/root/nginx-1.4.7# nginx -V
    nginx version: nginx/1.4.7
    built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) 
    TLS SNI support enabled
    configure arguments: --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre=/root/pcre-8.36 --with-
    
    http_realip_module
    front-end:/root/nginx-1.4.7# /usr/local/nginx/sbin/nginx -V
    nginx version: nginx/1.4.7
    built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) 
    TLS SNI support enabled
    configure arguments: --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre=/root/pcre-8.36 --with-
    
    http_realip_module --add-module=/root/nginx_syslog_patch/
    
    
    nginx 配置:
    
    syslog local6 nginx;
       #send the log to syslog and file.
       access_log  syslog:notice|logs/access.log main;
    
       # pre 1.5.x
       error_log syslog:notice|logs/error.log;
       sendfile        on;
       tcp_nopush     on;
    


    
    
    
    
    
    
    
       
    
    
  • 相关阅读:
    JS中parseInt()、Numer()深度解析
    如何写好.babelrc?Babel的presets和plugins配置解析
    懒加载和预加载
    vuex 的基本使用之Module
    vue 错误分析
    PrintWriter 和 Scanner 类的组合使用
    FileReader类和FileWriter类的基本用法示例
    Android SDK下载和更新失败的解决方法
    IntelliJ IDEA 14.x 创建工作空间与多个Java Web项目
    IntelliJ IDEA 14.x 与 Tomcat 集成,创建并运行Java Web项目
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199421.html
Copyright © 2011-2022 走看看