Apache Virtual Host Access Log Configuration example

Source: Internet
Author: User
Tags log log

Linux System Configuration methods:

Change it to

The code is as follows
ErrorLog "| /usr/local/apache/bin/rotatelogs/home/logs/www/%y_%m_%d_error_log 86400 480″
Customlog "| /usr/local/apache/bin/rotatelogs/home/logs/www/%y_%m_%d_access_log 86400 480″common

# # This is the log log code in HTTPD.CONF:

  code is as follows &nbs P;
ErrorLog" |/usr/local/cronolog/sbin/cro nolog/usr/local/apache-2.2.15/logs/error_log_%y%m%d "
LogLevel warn
<ifmodule log_config_module>
    Logformat "%h%l%u%t\"%r\ "%>s%b\"%{referer}i\ "\"%{user-agent}i\ "" Combined
&NBSP;&NBSP;&N Bsp Logformat "%h%l%u%t\"%r\ "%>s%b" common
    <ifmodule logio_module>
    ;   Logformat "%h%l%u%t\"%r\ "%>s%b\"%{referer}i\ "\"%{user-agent}i\ "%I%o" Combinedio
   ;  </ifmodule>
    Customlog "|/usr/local/cronolog/sbin/cronolog/usr/local/ apache-2.2.15/logs/access_log_%y%m%d "Combined
    customlog" |/usr/local/cronolog/sbin/ Cronolog/usr/local/apache-2.2.15/logs/referer_log "Referer
    customlog" |/usr/local/cronolog/sbin/cronolog/usr/local/apache-2.2.15/logs/ Agent_log "Agent
    #CustomLog" Logs/access_log "combined
</ifmodule>

Configuration methods under Windows system:

The code is as follows

ErrorLog "|bin/rotatelogs.exe logs/site1/error-%y%m%d.log 86400 480″
Customlog "|bin/rotatelogs.exe logs/site1/access-%y%m%d.log 86400 480″common

Specific access log examples

  code is as follows &nbs P;

<virtualhost 192.168.1.3:588>
DocumentRoot" e:/zzz/ "
ServerName 192.168.1.3

customlog" |bin/rotatelogs.exe logs/vicp_net_access-%y%m% D.log 86400 "Common

Rewriteengine on
rewriterule/wp-([0-9]+) (.?) $/plus/list.php?tid=$1
rewriterule/wp-([0-9]+)-([0-9]+)-([0-9]+) (.?) $/plus/list.php?tid=$1&totalresult=$2&ageno=$3
Rewriterule/([0-9]+) (.?) $/plus/view.php?arcid=$1


</virtualhost>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.