Nextcloud apache2 issue (Need to discuss)

Hi

I am running Nextcloud instance on Debian 11. Apache2.4.

All of sudden, my apache2 stops working and need to restart manually.

Following are apache2 error logs

[mpm_prefork:notice] [pid 293859] AH00171: Graceful restart requested, doing restart

[http2:warn] [pid 386911] AH10034: The mpm module (prefork.c) is not supported by mod_http2

[core:warn] [pid 386911] AH00098: pid file /var/run/apache2/apache2.pid overwritten – Unclean shutdown of previous Apache run?

[mpm_prefork:notice] [pid 386911] AH00169: caught SIGTERM, shutting down

Syslog
apache2.service: Killing process 383505 (/usr/sbin/apach) with signal SIGKILL.

Have any one experienced this type of issue?

Hi @zohaib09,
You are missing the required support template. Please fill this form out and edit into your post.

This will give us the technical info and logs needed to help you! Thanks.

Nextcloud version (eg, 20.0.5) : `24.0.5
Operating system and version (eg, Ubuntu 20.04) : Debian 11
Apache or nginx version (eg, Apache 2.4.25) : Apache/2.4.54 (Debian)
PHP version (eg, 7.4) : PHP 8.0.24

The issue you are facing: Apache stops working once in 24 hours, and have restart apache service manually

Is this the first time you’ve seen this error? Y (since last few days)

The output of your Nextcloud log in Admin > Logging :
|Error|PHP|Error: rename(/var/log/nextcloud.log,/var/log/nextcloud.log.1): Permission denied at /var/www/html/nextcloud/files/lib/public/Log/RotationTrait.php#52||2022-10-08T21:50:02+0500|
|Error|no app in context|OCP\Files\NotFoundException: No mount for path /files_encryption/OC_DEFAULT_MODULE/pubShare_43009bd8.publicKey existing mounts:||2022-10-08T21:46:52+0500|

The output of your Apache/nginx/system log in /var/log/____ :

[Sat Oct 08 09:06:13.220482 2022] [mpm_prefork:notice] [pid 293859] AH00171: Graceful restart requested, doing restart
AH00557: apache2: apr_sockaddr_info_get() failed for servername
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 mess>
[Sat Oct 08 09:06:13.276095 2022] [http2:warn] [pid 293859] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are proces>
Sat Oct 8 09:06:13 2022 (293859): Fatal Error Unable to create lock file: Bad file descriptor (9)
[Sat Oct 08 09:06:17.717821 2022] [http2:warn] [pid 386911] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are proces>
[Sat Oct 08 09:06:17.741732 2022] [core:warn] [pid 386911] AH00098: pid file /var/run/apache2/apache2.pid overwritten – Unclean shutdown of previous Apache run?
[Sat Oct 08 09:06:17.746772 2022] [mpm_prefork:notice] [pid 386911] AH00163: Apache/2.4.54 (Debian) SVN/1.14.1 OpenSSL/1.1.1n mod_perl/2.0.11 Perl/v5.32.1 configured →
[Sat Oct 08 09:06:17.746806 2022] [core:notice] [pid 386911] AH00094: Command line: ‘/usr/sbin/apache2’
[Sat Oct 08 09:06:17.911089 2022] [mpm_prefork:notice] [pid 386911] AH00169: caught SIGTERM, shutting down

any solution?

Not related to nextcloud imho, try

a2dismod mod_http2 && systemctl reload apache2

but i do nor know if this works…

This will most likely work, but is more like a workaround rather than a solution.

@zohaib09
If you want to enable HTTP/2 you need to use mpm event instead of mpm prefork. You can try the following:

https://http2.co/how-to-fix-ah10034-the-mpm-module-prefork-c-is-not-supported-by-mod_http2/

Note: You have to change the PHP version in the commands to the one you are using… e.g. apt install php8.0-fpm

After you switched to PHP-FPM and enabled mpm event you can enable htttp/2:

From my notes: (again you have to adjust the commands to your PHP version)

Enable HTTP2

Enable the HTTP2 Apache module and restart all relevant services:

a2enmod http2 && systemctl restart php8.1-fpm && systemctl restart apache2

Create the http2.conf file…

nano /etc/apache2/conf-available/http2.conf

…and paste in the following:

<IfModule http2_module>
Protocols h2 h2c http/1.1
H2Direct on
H2StreamMaxMemSize 5120000000
</IfModule>

Save the file and exit nano.

Enable the configuration and restart Apache:

a2enconf http2 && systemctl restart apache2

Hope that helps.

1 Like

Thank you, I have disabled http2 mod, lets see if it works.

Performance would most likely be better with http2 turned on :wink:

1 Like

Hi

@bb77 I am getting this type of errors in nextcloud logs.

Error no app in context OCP\Files\NotFoundException: No mount for path /files_encryption/OC_DEFAULT_MODULE/pubShare_43009bd8.publicKey existing mounts:

I have recently upgraded to Nextcloud 24.0.6. Anyone face this similar error?

Hi

Today apache2 again stopped working, and had to restart manually

these are apache2 error logs

[Wed Oct 12 07:56:13.316228 2022] [mpm_prefork:notice] [pid 485651] AH00171: Graceful restart requested, doing restart
Wed Oct 12 07:56:13 2022 (485651): Fatal Error Unable to create lock file: Bad file descriptor (9)
[Wed Oct 12 07:56:17.790476 2022] [core:warn] [pid 636896] AH00098: pid file /var/run/apache2/apache2.pid overwritten – Unclean shutdown of previous Apache run?
[Wed Oct 12 07:56:17.795065 2022] [mpm_prefork:notice] [pid 636896] AH00163: Apache/2.4.54 (Debian) SVN/1.14.1 OpenSSL/1.1.1n mod_perl/2.0.11 Perl/v5.32.1 configured →
[Wed Oct 12 07:56:17.795097 2022] [core:notice] [pid 636896] AH00094: Command line: ‘/usr/sbin/apache2’
[Wed Oct 12 07:56:17.948205 2022] [mpm_prefork:notice] [pid 636896] AH00169: caught SIGTERM, shutting down

Any suggestion please . http2 disabling does not work

Hi

Disabling opcache in php.ini seems resolved issue. I will update here if this problem repeats. This may help others too if have similar issues.