是否有人知道文件访问日志存储在哪里,所以我可以运行一个tail -f
命令来查看谁正在访问特定的文件。
我有XAMPP,它是安装在我的计算机上的Apache服务器,它自动记录访问。它存储在我的安装文件夹中。
发布于 2012-05-19 12:54:56
最终,这取决于您的Apache配置。查找Apache中的CustomLog
指令,参见手册中的示例。
所有日志文件的一个典型位置是/var/log
和子目录。尝试/var/log/apache/access.log
、/var/log/apache2/access.log
或/var/log/httpd/access.log
。如果日志不存在,请尝试运行locate access.log access_log
。
发布于 2015-01-27 19:28:14
如果您无法使用吉尔斯的回答找到日志,您还可以尝试一些其他的方法。
/var/log/httpd
。sudo locate access.log
和sudo locate access_log
。除了根文件之外,我的系统上的日志是不可见的,文件名为access_log
,而不是access.log
。发布于 2016-03-11 06:47:10
Apache服务器记录所有传入请求和处理到日志文件的所有请求。访问日志的格式是高度可配置的。访问日志的位置和内容由CustomLog指令控制。默认的apache访问日志文件位置:
RHEL / Red / CentOS /访问文件位置-
/var/log/httpd/access_log
Debian / Ubuntu Linux Apache访问日志文件位置-
/var/log/apache2/access.log
FreeBSD Apache访问日志文件位置-
/var/log/httpd-access.log
要找到确切的apache日志文件位置,可以使用grep命令:
# grep CustomLog /usr/local/etc/apache22/httpd.conf
# grep CustomLog /etc/apache2/apache2.conf
# grep CustomLog /etc/httpd/conf/httpd.conf
样本输出:
# a CustomLog directive (see below).
#CustomLog "/var/log/httpd-access.log" common
CustomLog "/var/log/httpd-access.log" combined
https://unix.stackexchange.com/questions/38978
复制相似问题