【问题标题】:Discover any remaining apache logs发现任何剩余的 apache 日志
【发布时间】:2019-10-19 12:58:51
【问题描述】:

我不熟悉 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/* 中的日志之外是否还会填充任何日志?

【问题讨论】:

    标签: apache2 apache2.4


    【解决方案1】:

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

    你应该知道:

    • /dev/stdout 是一个特殊的路径,可以重定向所有你 在进程外写入标准

    • /dev/stderr 与 abobe 相同,但重定向到标准错误 过程

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

    额外:默认的 apache2 日志位置不等于每个操作系统。其中一些 envvars 文件不存在。

    【讨论】:

    • apache2 -V 不会尊重envvars
    猜你喜欢
    • 1970-01-01
    • 2012-08-05
    • 2023-02-07
    • 1970-01-01
    • 1970-01-01
    • 2010-11-13
    • 1970-01-01
    • 2019-08-12
    • 1970-01-01
    相关资源
    最近更新 更多