Назад | Перейти на главную страницу

Apache2 записывает журнал доступа, но не журнал ошибок

Мой сервер apache2 без проблем записывает в журнал доступа к vhost, но не может записывать журналы ошибок.
Vhost настроен следующим образом:

<VirtualHost *:80>
    ServerName sub.domain.com
    Redirect permanent / https://sub.domain.com/
</VirtualHost>


<VirtualHost *:443>
       ServerName sub.domain.com
       ServerAdmin administrator@domain.com
       DocumentRoot /home/webadmin/web/www.domain.com/
       <Directory /home/webadmin/web/www.domain.com/>
                Order allow,deny
                Allow from all
                Require all granted
                Allowoverride All
       </Directory>

       SSLEngine on
       SSLCertificateFile    /etc/apache2/ssl/domain.com.2017.crt
       SSLCertificateKeyFile /etc/apache2/ssl/domain.com.2017.key
       SSLCACertificateFile /etc/apache2/ssl/domain.com.2017.ca.crt
       Header always set Strict-Transport-Security "max-age=15768000"

       Customlog "|/usr/bin/rotatelogs /home/webadmin/logs/www.domain.com/ex%y%m%d.log 86400" combined
       Errorlog "|/usr/bin/rotatelogs /home/webadmin/logs/www.domain.com/er%y%m%d.log 86400"
</VirtualHost>

apache2ctl -S выходы:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server othersub.domain.com (/etc/apache2/sites-enabled/othersub.domain.com.conf:1)
         port 80 namevhost othersub.domain.com (/etc/apache2/sites-enabled/othersub.domain.com.conf:1)
         port 80 namevhost sub.domain.com (/etc/apache2/sites-enabled/sub.domain.com.conf:1)
*:443                  is a NameVirtualHost
         default server othersub.domain.com (/etc/apache2/sites-enabled/othersub.domain.com.conf:7)
         port 443 namevhost othersub.domain.com (/etc/apache2/sites-enabled/othersub.domain.com.conf:7)
         port 443 namevhost sub.domain.com (/etc/apache2/sites-enabled/sub.domain.com.conf:7)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

Есть идеи, почему журналы ошибок не появляются?

Похоже, для настраиваемого журнала ошибок пока нет ошибок.

В rotatelogs --help интересны эти два варианта:

-f       Force opening of log on program start.
-c       Create log even if it is empty.

Я попробовал на своем сайте тестовую машину с этими настройками внутри VirtualHost тег:

Customlog "|/usr/bin/rotatelogs -f /var/log/apache2/ex%y%m%d.log 86400" combined
Errorlog "|/usr/bin/rotatelogs -f /var/log/apache2/er%y%m%d.log 86400"

Затем ex170925.log появился, хотя он был пуст.