Example of apache virtual host access log configuration

Source: Internet
Author: User

Next, let's take a look at the log configuration commands in linux and windows.

Linux system configuration method:

Change it

The code is as follows: Copy code
ErrorLog "|/usr/local/apache/bin/rotatelogs/home/logs/www/% Y _ % m _ % d_error_log 86400 480 & Prime;
CustomLog "|/usr/local/apache/bin/rotatelogs/home/logs/www/% Y _ % m _ % d_access_log 86400 480 & Prime; common

# This is the log code in httpd. conf:

The code is as follows: Copy code
# ErrorLog "logs/error_log"
ErrorLog "|/usr/local/cronolog/sbin/cronolog/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
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 method in Windows:

The code is as follows: Copy code

ErrorLog "| bin/rotatelogs.exe logs/site1/error-% y % m % d. log 86400 480 & Prime;
CustomLog "| bin/rotatelogs.exe logs/site1/access-% y % m % d. log 86400 480 & Prime; common

Access log examples

The code is as follows: Copy code


<Virtualhost192.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 480" 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.