发现任何剩余的Apache日志

时间:2019-06-04 01:45:54

标签: apache2 apache2.4

我不熟悉Apache2-我想找出日志的去向-我有此apache2.conf内容:

ServerName 0.0.0.0
ErrorLog /dev/stderr
TransferLog /dev/stdout
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog /dev/stderr
LogLevel warn 
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory "/*" >
    #Options FollowSymLinks
    #AllowOverride None
    #Require all denied
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
    Allow from all
</Directory>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-available/*.conf
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf

和这些envvars

unset HOME
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
    SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
else
    SUFFIX=
fi
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
export APACHE_LOG_DIR=/var/log/apache2$SUFFIX
export LANG=C
. /etc/default/locale
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib/:$LD_LIBRARY_PATH
export NLTK_DATA=/nltk_data

除了/var/log/apache2/*中的日志之外,是否有人会填充其他日志?

1 个答案:

答案 0 :(得分:0)

httpd -Vapache2ctl -V会告诉您正在使用的日志位置,除此之外没有其他位置。

您应该知道:

  • /dev/stdout是一条特殊的路径,可以重定向您所有的内容 从流程中写入标准

  • /dev/stderr与上文相同,但重定向到 处理

  • /dev/null与abobe相同,只是重定向而不是重定向 丢弃

额外:默认的apache2日志位置并不等于每个O.S.。并且其中有些envvars文件不存在。