apache虛擬機器主機訪問日誌配置例子

來源:互聯網
上載者:User

   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>

相關文章

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。