Upgrade Debian - apache2 crashes

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Centaurus17
Posts: 47
Joined: Fri Sep 06, 2013 7:44 am
Location: Europe/Austria

Upgrade Debian - apache2 crashes

Post by Centaurus17 »

Hi,

because I did not get an answere to my question here I tried to upgrade my system from Debian 11 -> 12. After the upgrade the system shows an error-message at booting 'failed to start apache2.service' - but zm seems to run (the process is running and the cpu-load is suitable). But apache2 is not running, so I have no access to zm.

In var/log/apache2 I found an error.log:

Code: Select all

[Tue Sep 24 00:00:29.184706 2024] [mpm_prefork:notice] [pid 625:tid 625] AH00163: Apache/2.4.62 (Debian) configured -- resuming normal operations
[Tue Sep 24 00:00:29.184733 2024] [core:notice] [pid 625:tid 625] AH00094: Command line: '/usr/sbin/apache2'
[Tue Sep 24 08:18:57.872672 2024] [mpm_prefork:notice] [pid 625:tid 625] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Sep 24 09:35:44.000791 2024] [mpm_prefork:notice] [pid 619:tid 619] AH00163: Apache/2.4.62 (Debian) configured -- resuming normal operations
[Tue Sep 24 09:35:44.001369 2024] [core:notice] [pid 619:tid 619] AH00094: Command line: '/usr/sbin/apache2'
[Tue Sep 24 10:49:55.017195 2024] [mpm_prefork:notice] [pid 619:tid 619] AH00169: caught SIGTERM, shutting down
Any hints? Please help to fix this...

Thx
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Upgrade Debian - apache2 crashes

Post by iconnor »

Those are normal messages.

How about trying sudo systemctl start apache2
For further debugging systemctl status apache2
or journalctl -fu apache2
Centaurus17
Posts: 47
Joined: Fri Sep 06, 2013 7:44 am
Location: Europe/Austria

Re: Upgrade Debian - apache2 crashes

Post by Centaurus17 »

One step forward:
  • First apache2 did not run - apache2 error.log: 'caught SIGTERM, shutting down' ... this I could fix.
  • Apache2 is now running ... but the zm-console does not work - 'htt*://IP#/zm/' brings a lot of debugging infos.
  • There are 2 Versions of php - 7.4 and 8.2 - in the system ... maybe there is something mixed up between this versions.?
  • 'sudo journalctl -u apache2 --no-pager' shows e.g.:

    Code: Select all

    Sep 24 11:59:01 debian systemd[1]: Starting apache2.service - The Apache HTTP Server...
    Sep 24 11:59:01 debian apachectl[3405]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.4.load: Cannot load /usr/lib/apache2/modules/libphp7.4.so into server: /usr/lib/apache2/modules/libphp7.4.so: cannot open shared object file: No such file or directory
    Sep 24 11:59:01 debian apachectl[3402]: Action 'start' failed.
    Sep 24 11:59:01 debian apachectl[3402]: The Apache error log may have more information.
    Sep 24 11:59:01 debian systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
    Sep 24 11:59:01 debian systemd[1]: apache2.service: Failed with result 'exit-code'.
    Sep 24 11:59:01 debian systemd[1]: Failed to start apache2.service - The Apache HTTP Server.
    ...
    Sep 24 16:07:46 debian apachectl[47850]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
    ...
    
Apache2-error.log:

Code: Select all

[Tue Sep 24 18:36:49.270580 2024] [mpm_prefork:notice] [pid 701:tid 701] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Sep 24 18:37:32.480681 2024] [mpm_prefork:notice] [pid 697:tid 697] AH00163: Apache/2.4.62 (Debian) configured -- resuming normal operations
[Tue Sep 24 18:37:32.483019 2024] [core:notice] [pid 697:tid 697] AH00094: Command line: '/usr/sbin/apache2'
???
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Upgrade Debian - apache2 crashes

Post by iconnor »

apache is still trying to use php7.4 but it is mostly missing. I would start by sudo apt remove --purge php7.4*
Then sudo a2dismod php7.4
sudo a2enmod php8.2

Then apache should run
Centaurus17
Posts: 47
Joined: Fri Sep 06, 2013 7:44 am
Location: Europe/Austria

Re: Upgrade Debian - apache2 crashes

Post by Centaurus17 »

Thanks ... done ... I got the following messages:

Code: Select all

ich@debian:~$ sudo a2dismod php7.4
Module php7.4 already disabled
ich@debian:~$ sudo a2enmod php8.2
Considering dependency mpm_prefork for php8.2:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php8.2:
Module php8.2 already enabled
ich@debian:~$ sudo service apache2 restart
... apache2 is running :D ... now the console-screen is shown with 'h*tp://IP#/zm/' ... but it is not formatted, no graphic-buttons, no lines, it is incomplete ... screenshot:

Image
Centaurus17
Posts: 47
Joined: Fri Sep 06, 2013 7:44 am
Location: Europe/Austria

Re: Upgrade Debian - apache2 crashes

Post by Centaurus17 »

FYI: I made a backstep and restored the running Debian-11-installation (to be on safe I cloned the system with Clonezilla before upgrading zu Debian-12). I will try a clean installation (Deb 12 + zm) soon...

Thanks.
Post Reply