请选择时期:
怀孕准备 怀孕 分娩 宝宝0-1岁 宝宝1-3岁 宝宝3-6岁

apache虚拟主机访问日志配置例子

来源: 最后更新:22-12-05 09:07:14

导读:apache虚拟主机访问日志配置例子 Linux系统配置方法: 将其改为 代码如下 ErrorLog “| /usr/local/apache/bin/rota

Linux系统配置方法:

将其改为

代码如下
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

## 这是httpd.conf中的log日志代码:

代码如下
#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>

Windows系统下配置方法:

代码如下

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

具体访问日志例子

代码如下

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

标签: VirtualHost  arcID  IfModule  

免责声明:本文系转载,版权归原作者所有;旨在传递信息,其原创性以及文中陈述文字和内容未经本站证实。

本文地址:http://www.jxyuer.com/qiaomen/youxi/470987.html

声明: 本站文章均来自互联网,不代表本站观点 如有异议 请与本站联系 联系邮箱:jxyuer#foxmail.com (请把#替换成@)

关于我们 | 广告服务 | 网站合作 | 免责声明 | 联系我们| 网站地图

© 2022-2024 江西育儿网 all rights reserved. 沪ICP备2023005727号-3