The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to raw log in access_log

Discussion in 'General Discussion' started by jmginer, Jun 18, 2012.

  1. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Benifato, Spain
    Hi,

    I want write in the /usr/local/apache/logs/access_log file the same as in the raw log,

    like:

    xx.xx.xx.xx - - [18/Jun/2012:18:04:42 +0200] "GET /images/file.png HTTP/1.1" 304 - "http://xxx.com" "Opera/9.80 (Windows NT 6.1; WOW64; U; en) Presto/2.10.229 Version/11.64"

    I tried to modify in httpd.conf

    from

    Code:
    <IfModule log_config_module>
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
        LogFormat "%h %l %u %t \"%r\" %>s %b" common
    
        CustomLog "logs/access_log" common
    
        <IfModule logio_module>
            LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    
        </IfModule>
    to

    Code:
    <IfModule log_config_module>
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
        LogFormat "%h %l %u %t \"%r\" %>s %b" common
    
        CustomLog "logs/access_log" [B]combined[/B]
    
        <IfModule logio_module>
            LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    
        </IfModule>
    But seems is not the good way.
    Any help please?

    Thanks!
     
    #1 jmginer, Jun 18, 2012
    Last edited: Jun 18, 2012
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    By not the good way, do you mean the changes aren't being saved when you rebuild Apache? If so, you can distill changes using the following

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    This only pertains to sections outside the VirtualHost entries. Any VirtualHost changes (for domains on accounts) need to have includes in /usr/local/apache/conf/userdata created instead.

    Once you've distilled the changed to httpd.conf, then restart Apache:

    Code:
    /etc/init.d/httpd restart
    Please let us know whether this is the issue or something else.

    Thanks!
     
Loading...

Share This Page