访问日志记录用户的每一个请求
# vim /usr/local/apache2.4/conf/httpd.conf //搜索LogFormat
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
日志有两种格式,一种比较简单,一种比较详细
把虚拟主机配置文件改成如下:
<VirtualHost *:80> DocumentRoot "/data/wwwroot/ahao1.com" ServerName www.ahao1.com ServerAlias ahao1.com CustomLog "logs/ahao1.com-access_log" combined </VirtualHost>
重新加载配置文件
# /usr/local/httpd/bin/apachectl graceful
# curl -x127.0.0.1:80 -I ahao1.com/1.php
# tail /usr/local/httpd/logs/ahao1.com-access_log


