修改Apache2配置文件,修改“LogFormat”行,将“%h”更改为“%a”。
示例代码:
sudo nano /etc/apache2/apache2.conf
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%a %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
保存并关闭文件。
重启Apache2服务:
sudo service apache2 restart