gpt4 book ai didi

apache - 在 ubuntu 上运行的 apache 中启用 mod_rewrite 日志

转载 作者:行者123 更新时间:2023-12-04 18:37:50 25 4
gpt4 key购买 nike

我试图启用日志记录。我启用了 mod rewrite 并重新启动了计算机,由于某种原因,重写日志没有写入目标目录/var/lib/log

我想知道是否有人之前成功完成过,请在这里发布,以便我试一试。

cat /etc/issue
Ubuntu 16.04.1 LTS \n \l

apache2 -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2016-07-14T12:32:26
/var/log/apache2$ ls
access.log access.log.3.gz error.log.1 error.log.4.gz
access.log.1 access.log.4.gz error.log.10.gz error.log.5.gz
access.log.10.gz access.log.5.gz error.log.11.gz error.log.6.gz
access.log.11.gz access.log.6.gz error.log.12.gz error.log.7.gz
access.log.12.gz access.log.7.gz error.log.13.gz error.log.8.gz
access.log.13.gz access.log.8.gz error.log.14.gz error.log.9.gz
access.log.14.gz access.log.9.gz error.log.2.gz other_vhosts_access.log
access.log.2.gz error.log error.log.3.gz
<VirtualHost *:80>
ServerName odyss{shadow}.odysseysafaris.com
ServerAdmin
DocumentRoot /var/www/html/{shadow}
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html/{shadow}">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

</Directory>

</VirtualHost>

最佳答案

Apache 在 2.4 中没有自己的 mod_rewrite 日志。它记录到错误日志中。见 Apache Module mod_rewrite - Logging完整的细节。

最后一节特别相关:

RewriteLog

Those familiar with earlier versions of mod_rewrite will no doubt be looking for the RewriteLog and RewriteLogLevel directives. This functionality has been completely replaced by the new per-module logging configuration mentioned above.

To get just the mod_rewrite-specific log messages, pipe the log file through grep:

tail -f error_log|fgrep '[rewrite:'



此外,您似乎没有添加任何指令来激活日志记录。添加类似:
LogLevel rewrite:trace1

这只会更改 mod_rewrite 日志记录,而不会影响其他任何内容。有关更多信息,请参见上面的链接并参见 LogLevel :

Specifying a level with a module name will set the level for that module only.

关于apache - 在 ubuntu 上运行的 apache 中启用 mod_rewrite 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41420230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com