• 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;
    


    
    
    
    
    
    
    
       
    
    
  • 相关阅读:
    什么是API
    Maxiee的Vim入门日记(4)——安装windows下的Cscope
    将字符串变成大写----C++实现
    POJ 3254 炮兵阵地(状态压缩DP)
    UIKit和Core Graphics绘图(三)——绘制虚线,椭圆以及饼图
    CRC 模式及实现
    [HDU 1317]XYZZY[SPFA变形][最长路]
    poj 2155 Matrix
    [置顶] Application,Session,Cookie之Application对象
    [Todo] Java及C++ Exception整理
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199420.html
Copyright © 2020-2023  润新知