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;
    


    
    
    
    
    
    
    
       
    
    
  • 相关阅读:
    弱引用的字典WeakDictionary(转)
    XBox360调试程序失败:Unable to start debugging.Connection to Xbox360 development kit lost
    托管C++中的范型和模板的区别
    智能指针的缺陷
    托管C++笔记(二)原创
    C#通过WMI操作本地共享文件夹
    很随便的随笔
    "The system cannot execute the specified program"
    C++多重继承
    托管C++笔记(一)原创
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199420.html
Copyright © 2011-2022 走看看