Keep Server Online
  
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
  
or
  
 
  
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
  
Thank You! Steffen
  
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
 |    |   
 | 
     Topic: Apache doesn't log system | 
 |   
| Author | 
  | 
 
Pitmaster
 
 
  Joined: 20 Sep 2022 Posts: 3 Location: Krimpen aan den IJssel
  | 
 Posted: Mon 03 Mar '25 18:03    Post subject: Apache doesn't log system | 
     | 
 
  | 
 
Hi all,
 
My apache logs access and error for all my vhosts but a short while ago he stopped logging system activity. No restarts, no failures at restart etc.
 
There appears nothing in /var/log/apache2/error.log I set LogLevel trace8.
 
 
Where to look to reactivate?
 
 
Thx, Pit
 
 
root@familieberg:/etc/apache2# apache2 -V
 
Server version: Apache/2.4.62 (Debian)
 
Server built:   2024-10-04T15:21:08
 
Server's Module Magic Number: 20120211:136
 
Server loaded:  APR 1.7.0, APR-UTIL 1.6.1, PCRE 8.45 2021-06-15
 
Compiled using: APR 1.7.0, APR-UTIL 1.6.1, PCRE 8.39 2016-06-14
 
Architecture:   64-bit
 
Server MPM:     prefork
 
  threaded:     no
 
    forked:     yes (variable process count)
 
Server compiled with....
 
 -D APR_HAS_SENDFILE
 
 -D APR_HAS_MMAP
 
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 
 -D APR_USE_PROC_PTHREAD_SERIALIZE
 
 -D APR_USE_PTHREAD_SERIALIZE
 
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 
 -D APR_HAS_OTHER_CHILD
 
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 
 -D DYNAMIC_MODULE_LIMIT=256
 
 -D HTTPD_ROOT="/etc/apache2"
 
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 
 -D DEFAULT_ERRORLOG="logs/error_log"
 
 -D AP_TYPES_CONFIG_FILE="mime.types"
 
 -D SERVER_CONFIG_FILE="apache2.conf" | 
 
  | 
 
| Back to top | 
 | 
 
James Blond Moderator
  
  Joined: 19 Jan 2006 Posts: 7443 Location: EU, Germany, Next to Hamburg
  | 
 Posted: Tue 04 Mar '25 9:41    Post subject: Re: Apache doesn't log system | 
     | 
 
  | 
 
Within the global scope, there should be
 
 
ErrorLog /var/log/apache2/error.log
 
 
Is there log rotation in your /var/log/apache2/ directory?
 
 
Maybe you 
 
 
 	  | Code: | 	 		  
 
cd /var/log/apache2/
 
zcat error.log-*
 
 | 	 
  | 
 
  | 
 
| Back to top | 
 | 
 
Pitmaster
 
 
  Joined: 20 Sep 2022 Posts: 3 Location: Krimpen aan den IJssel
  | 
 Posted: Tue 04 Mar '25 10:25    Post subject: Re: Apache doesn't log system | 
     | 
 
  | 
 
 	  | James Blond wrote: | 	 		  Within the global scope, there should be
 
 
ErrorLog /var/log/apache2/error.log
 
 
Is there log rotation in your /var/log/apache2/ directory?
 
 
Maybe you 
 
 
 	  | Code: | 	 		  
 
cd /var/log/apache2/
 
zcat error.log-*
 
 | 	 
  | 	  
 
 
gzip: error.log-*.gz: No such file or directory
 
 
So, no!
 
 
And ErrorLog /var/log/apache2/error.log is in apache2.conf
 
 
Pit | 
 
  | 
 
| Back to top | 
 | 
 
Pitmaster
 
 
  Joined: 20 Sep 2022 Posts: 3 Location: Krimpen aan den IJssel
  | 
 Posted: Tue 04 Mar '25 10:42    Post subject:  | 
     | 
 
  | 
 
I looked for logrotate:
 
/etc/logrotate.conf
 
 	  | Code: | 	 		  
 
# see "man logrotate" for details
 
 
# global options do not affect preceding include directives
 
 
# rotate log files weekly
 
weekly
 
 
# keep 4 weeks worth of backlogs
 
rotate 4
 
 
# create new (empty) log files after rotating old ones
 
create
 
 
# use date as a suffix of the rotated file
 
#dateext
 
 
# uncomment this if you want your log files compressed
 
#compress
 
 
# packages drop log rotation information into this directory
 
include /etc/logrotate.d
 
 
# system-specific logs may also be configured here.
 
 | 	  
 
 
And /etc/logrotate.d/apache
 
 	  | Code: | 	 		  
 
/var/log/apache2/*.log {
 
    daily
 
    missingok
 
    rotate 14
 
    compress
 
    delaycompress
 
    notifempty
 
    create 640 root adm
 
    sharedscripts
 
    prerotate
 
   if [ -d /etc/logrotate.d/httpd-prerotate ]; then
 
       run-parts /etc/logrotate.d/httpd-prerotate
 
   fi
 
    endscript
 
    postrotate
 
   if pgrep -f ^/usr/sbin/apache2 > /dev/null; then
 
       invoke-rc.d apache2 reload 2>&1 | logger -t apache2.logrotate
 
   fi
 
    endscript
 
}
 
 | 	  
 
 
The file httpd-prerotate is missing
 
ls /etc/logrotate.d
 
 
alternatives  apt   certbot	   clamav-freshclam  dpkg      mailman3  minetest-server  php8.0-fpm  php8.2-fpm  redis-server	rsyslog  ufw
 
apache2       btmp  clamav-daemon  dbconfig-common   fail2ban  mariadb	 php7.4-fpm	  php8.1-fpm  razor	  rkhunter	samba	 wtmp
 
 
Maybe, here is the problem?
 
Pit | 
 
  | 
 
| Back to top | 
 | 
 
 
 
 
 | 
 
 
 |  
 
 |  
  |   
 |