LogFormat apache 2.4 不起作用

Bru*_*377 3 apache-2.4

我试图mod_remoteip在单独的服务器中使用代理鱿鱼在 apache2.4 中进行配置,但 access.log 中的 IP 仍然是代理的 IP。我使用这个https://trick77.com/apache2-2-4-logging-remote-ip-address-using-mod_remoteip/

事实上,我已经发现,在/etc/apache2/apache2.conf命令中

LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
Run Code Online (Sandbox Code Playgroud)

access.log即使我更改文本或删除它,也不要更改格式。

有人可以帮忙吗?

Eps*_*pie 6

我发现使用昵称combined不起作用,因为它已经被占用了。所以这有效:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" %D"myawesomeformat

CustomLog ${APACHE_LOG_DIR}/access.logmyawesomeformat