Apache2 conflict after reboot on Ubuntu server

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 29.0.5): 28.0.6
Operating system and version (eg, Ubuntu 29.04): Ubuntu Linux 22.04.4
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.52 (Ubuntu)

PHP version (eg, 8.3): 8.1.2

The issue you are facing:
After a reboot apache2 service is active, but no connection to Nextcloud. If I stop apache2 with systemctl stop apache2 and then start it again with systemctl start apache2 - everything works. The problem with is that if the server reboots Nextcloud is not reachable. What do I do about it?

Is this the first time you’ve seen this error? (Y/N):N

Steps to replicate it:

  1. Reboot server

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

PASTE HERE

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

PASTE HERE

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

Hi Kirill,

Could you provide the apache2 service logs?
Do you have any errors on the service?

Are the other services working properly? I’m thinking of DB and Redis.

Is it possible that some service is required before starting Apache2?

Have a nice day,

Sharkof

Strange enough this error is gone now. I’ve force rebooted the system 10 times and nextcloud pops up evey time…

Ok, it’s strange but your issue is solved :smile:

Actually no… I spoke too soon. Another reboot - another failure here is the log from apache2:

[Sat Jun 22 00:00:02.623611 2024] [mpm_prefork:notice] [pid 1944622] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Sat Jun 22 00:00:02.623627 2024] [core:notice] [pid 1944622] AH00094: Command line: ‘/usr/sbin/apache2’
[Sat Jun 22 16:23:35.118520 2024] [access_compat:error] [pid 2092808] [client 10.0.4.72:49506] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Sat Jun 22 16:23:52.671104 2024] [mpm_prefork:notice] [pid 1944622] AH00170: caught SIGWINCH, shutting down gracefully
[Sat Jun 22 16:23:52.804703 2024] [ssl:warn] [pid 2100167] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Jun 22 16:23:52.871301 2024] [ssl:warn] [pid 2100168] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Jun 22 16:23:52.880271 2024] [mpm_prefork:notice] [pid 2100168] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Sat Jun 22 16:23:52.880301 2024] [core:notice] [pid 2100168] AH00094: Command line: ‘/usr/sbin/apache2’
[Sat Jun 22 16:25:16.914129 2024] [access_compat:error] [pid 2100171] [client 10.0.4.72:49838] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Sat Jun 22 16:27:58.514171 2024] [mpm_prefork:notice] [pid 2100168] AH00170: caught SIGWINCH, shutting down gracefully
[Sat Jun 22 16:28:58.055014 2024] [ssl:warn] [pid 1336] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Jun 22 16:28:59.375735 2024] [ssl:warn] [pid 1581] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Jun 22 16:28:59.389726 2024] [mpm_prefork:notice] [pid 1581] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Sat Jun 22 16:28:59.389759 2024] [core:notice] [pid 1581] AH00094: Command line: ‘/usr/sbin/apache2’
[Sat Jun 22 16:29:22.416570 2024] [core:notice] [pid 1581] AH00051: child pid 1690 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Sat Jun 22 16:29:22.417582 2024] [core:notice] [pid 1581] AH00051: child pid 1691 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Sat Jun 22 16:29:23.419587 2024] [core:notice] [pid 1581] AH00051: child pid 1692 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Sat Jun 22 16:29:26.425157 2024] [core:notice] [pid 1581] AH00051: child pid 1693 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Sat Jun 22 16:29:27.429161 2024] [core:notice] [pid 1581] AH00051: child pid 3143 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Sat Jun 22 16:29:42.445174 2024] [core:notice] [pid 1581] AH00051: child pid 3252 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Sat Jun 22 16:29:42.445273 2024] [core:notice] [pid 1581] AH00051: child pid 3253 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Sat Jun 22 16:29:43.450901 2024] [core:notice] [pid 1581] AH00051: child pid 1689 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Sat Jun 22 16:29:54.820740 2024] [mpm_prefork:notice] [pid 1581] AH00170: caught SIGWINCH, shutting down gracefully
[Sat Jun 22 16:30:01.288455 2024] [ssl:warn] [pid 3439] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Jun 22 16:30:01.321837 2024] [ssl:warn] [pid 3440] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Jun 22 16:30:01.329619 2024] [mpm_prefork:notice] [pid 3440] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Sat Jun 22 16:30:01.329652 2024] [core:notice] [pid 3440] AH00094: Command line: ‘/usr/sbin/apache2’
[Sat Jun 22 16:35:23.356253 2024] [access_compat:error] [pid 3445] [client 10.0.4.72:50470] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Sat Jun 22 16:36:17.308999 2024] [access_compat:error] [pid 3445] [client 10.0.4.72:50946] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Sat Jun 22 20:47:42.531471 2024] [mpm_prefork:notice] [pid 3440] AH00170: caught SIGWINCH, shutting down gracefully
[Sat Jun 22 20:48:28.427316 2024] [ssl:warn] [pid 1323] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Jun 22 20:48:29.716891 2024] [ssl:warn] [pid 1539] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sat Jun 22 20:48:29.741206 2024] [mpm_prefork:notice] [pid 1539] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Sat Jun 22 20:48:29.741243 2024] [core:notice] [pid 1539] AH00094: Command line: ‘/usr/sbin/apache2’
[Sat Jun 22 20:49:15.789152 2024] [access_compat:error] [pid 1685] [client 10.0.4.72:60226] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Sat Jun 22 20:49:32.637980 2024] [access_compat:error] [pid 1686] [client 10.0.4.72:60328] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Sun Jun 23 00:00:02.323807 2024] [mpm_prefork:notice] [pid 1539] AH00171: Graceful restart requested, doing restart
[Sun Jun 23 00:00:02.472763 2024] [ssl:warn] [pid 1539] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Jun 23 00:00:02.475160 2024] [mpm_prefork:notice] [pid 1539] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Sun Jun 23 00:00:02.475174 2024] [core:notice] [pid 1539] AH00094: Command line: ‘/usr/sbin/apache2’
[Sun Jun 23 14:28:34.734190 2024] [authz_core:error] [pid 8955] [client 10.0.4.72:40512] AH01630: client denied by server configuration: /var/www/html/nextcloud/server-status
[Sun Jun 23 14:28:34.754354 2024] [php:error] [pid 15046] [client 10.0.4.72:40526] script ‘/var/www/html/nextcloud/config.php’ not found or unable to stat
[Sun Jun 23 14:28:34.781775 2024] [access_compat:error] [pid 8955] [client 10.0.4.72:40536] AH01797: client denied by server configuration: /var/www/html/nextcloud/config/database.php
[Sun Jun 23 14:28:34.787423 2024] [access_compat:error] [pid 9522] [client 10.0.4.72:40542] AH01797: client denied by server configuration: /var/www/html/nextcloud/config/production.json
[Sun Jun 23 14:28:34.791753 2024] [php:error] [pid 8957] [client 10.0.4.72:40546] script ‘/var/www/html/nextcloud/phpinfo.php’ not found or unable to stat
[Sun Jun 23 14:28:35.740113 2024] [php:error] [pid 8957] [client 10.0.4.72:41044] script ‘/var/www/html/nextcloud/wp-config.php’ not found or unable to stat
[Mon Jun 24 00:00:01.691716 2024] [mpm_prefork:notice] [pid 1539] AH00171: Graceful restart requested, doing restart
[Mon Jun 24 00:00:01.902111 2024] [ssl:warn] [pid 1539] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 24 00:00:01.906682 2024] [mpm_prefork:notice] [pid 1539] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Mon Jun 24 00:00:01.906747 2024] [core:notice] [pid 1539] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Jun 24 13:43:58.905715 2024] [access_compat:error] [pid 442826] [client 10.0.4.72:39030] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jun 24 14:44:08.343750 2024] [access_compat:error] [pid 559498] [client 10.0.4.72:41598] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jun 24 15:05:34.981469 2024] [mpm_prefork:notice] [pid 1539] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Jun 24 16:30:19.266534 2024] [ssl:warn] [pid 1291] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 24 16:30:19.630342 2024] [ssl:warn] [pid 1559] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 24 16:30:19.649306 2024] [mpm_prefork:notice] [pid 1559] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Mon Jun 24 16:30:19.649341 2024] [core:notice] [pid 1559] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Jun 24 16:30:53.595932 2024] [access_compat:error] [pid 1639] [client 10.0.4.72:57812] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jun 24 16:31:54.043210 2024] [mpm_prefork:notice] [pid 1559] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Jun 24 16:43:47.738766 2024] [ssl:warn] [pid 1298] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 24 16:43:48.309621 2024] [ssl:warn] [pid 1521] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 24 16:43:48.320951 2024] [mpm_prefork:notice] [pid 1521] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Mon Jun 24 16:43:48.320981 2024] [core:notice] [pid 1521] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Jun 24 16:43:51.327507 2024] [core:notice] [pid 1521] AH00051: child pid 1643 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Mon Jun 24 16:44:25.720600 2024] [mpm_prefork:notice] [pid 1521] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Jun 24 16:45:07.577685 2024] [ssl:warn] [pid 1317] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 24 16:45:08.237417 2024] [ssl:warn] [pid 1540] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Jun 24 16:45:08.249545 2024] [mpm_prefork:notice] [pid 1540] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Mon Jun 24 16:45:08.249577 2024] [core:notice] [pid 1540] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Jun 24 17:00:00.386441 2024] [access_compat:error] [pid 1651] [client 10.0.4.72:33118] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jun 24 17:26:43.267334 2024] [access_compat:error] [pid 1650] [client 10.0.4.72:40957] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jun 24 18:13:22.856033 2024] [access_compat:error] [pid 1650] [client 10.0.4.72:44076] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jun 24 18:15:17.956738 2024] [access_compat:error] [pid 1649] [client 10.0.4.72:44644] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jun 24 21:31:38.470891 2024] [access_compat:error] [pid 1649] [client 10.0.4.72:56830] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Tue Jun 25 00:00:03.366444 2024] [mpm_prefork:notice] [pid 1540] AH00171: Graceful restart requested, doing restart
[Tue Jun 25 00:00:03.597216 2024] [ssl:warn] [pid 1540] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Jun 25 00:00:03.609109 2024] [mpm_prefork:notice] [pid 1540] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Tue Jun 25 00:00:03.609187 2024] [core:notice] [pid 1540] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Jun 25 11:05:07.262957 2024] [access_compat:error] [pid 109693] [client 10.0.4.72:39048] AH01797: client denied by server configuration: /var/www/html/nextcloud/config/production.json
[Tue Jun 25 11:05:07.492014 2024] [php:error] [pid 109691] [client 10.0.4.72:39066] script ‘/var/www/html/nextcloud/wp-config.php’ not found or unable to stat
[Tue Jun 25 11:05:07.529117 2024] [php:error] [pid 117530] [client 10.0.4.72:39074] script ‘/var/www/html/nextcloud/config.php’ not found or unable to stat
[Tue Jun 25 11:05:07.548515 2024] [access_compat:error] [pid 109696] [client 10.0.4.72:39086] AH01797: client denied by server configuration: /var/www/html/nextcloud/config/database.php
[Tue Jun 25 11:05:07.549024 2024] [php:error] [pid 117534] [client 10.0.4.72:39092] script ‘/var/www/html/nextcloud/phpinfo.php’ not found or unable to stat
[Tue Jun 25 11:05:07.553621 2024] [authz_core:error] [pid 110268] [client 10.0.4.72:39098] AH01630: client denied by server configuration: /var/www/html/nextcloud/server-status
[Tue Jun 25 13:14:30.702590 2024] [access_compat:error] [pid 117530] [client 10.0.4.72:48406] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Tue Jun 25 14:03:00.802738 2024] [access_compat:error] [pid 156584] [client 10.0.4.72:52320] AH01797: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Tue Jun 25 14:05:44.999056 2024] [mpm_prefork:notice] [pid 1540] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Jun 25 14:06:28.473917 2024] [ssl:warn] [pid 1319] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Jun 25 14:06:29.128276 2024] [ssl:warn] [pid 1541] AH01906: wookiee:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue Jun 25 14:06:29.136549 2024] [mpm_prefork:notice] [pid 1541] AH00163: Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 configured – resuming normal operations
[Tue Jun 25 14:06:29.136583 2024] [core:notice] [pid 1541] AH00094: Command line: ‘/usr/sbin/apache2’
[Tue Jun 25 14:06:50.161263 2024] [core:notice] [pid 1541] AH00051: child pid 1640 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Jun 25 14:06:50.161348 2024] [core:notice] [pid 1541] AH00051: child pid 1642 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Jun 25 14:06:57.167186 2024] [core:notice] [pid 1541] AH00051: child pid 1643 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Jun 25 14:06:59.173847 2024] [core:notice] [pid 1541] AH00051: child pid 2164 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Jun 25 14:06:59.173980 2024] [core:notice] [pid 1541] AH00051: child pid 2318 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Jun 25 14:07:06.180629 2024] [core:notice] [pid 1541] AH00051: child pid 2319 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Jun 25 14:07:09.185380 2024] [core:notice] [pid 1541] AH00051: child pid 1639 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Jun 25 14:08:11.252707 2024] [core:notice] [pid 1541] AH00051: child pid 1641 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Tue Jun 25 14:08:26.268647 2024] [core:notice] [pid 1541] AH00051: child pid 2337 exit signal Segmentation fault (11), possible coredump in /etc/apache2

and this is what systemctl thinks at the same time:

● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-06-25 14:06:28 MSK; 2min 59s ago
Docs: Apache HTTP Server Version 2.4 Documentation - Apache HTTP Server Version 2.4
Process: 1294 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 1541 (apache2)
Tasks: 6 (limit: 14076)
Memory: 745.7M
CPU: 2.888s
CGroup: /system.slice/apache2.service
├─1541 /usr/sbin/apache2 -k start
├─3559 /usr/sbin/apache2 -k start
├─3921 /usr/sbin/apache2 -k start
├─4331 /usr/sbin/apache2 -k start
├─4335 /usr/sbin/apache2 -k start
└─4336 /usr/sbin/apache2 -k start

Jun 25 14:06:27 wookiee systemd[1]: Starting The Apache HTTP Server…
Jun 25 14:06:28 wookiee systemd[1]: Started The Apache HTTP Server.

I’ve check on many forum and I find one thing for this error :
not found or unable to stat
https://serverfault.com/questions/185954/hosts-file-entries-for-multiple-domains-on-vps

For this error :
AH01797: client denied by server configuration:
I found this link for plesk but the error is the same :
https://support.plesk.com/hc/en-us/articles/12377520889367-Website-is-not-accessible-403-Forbidden-AH01797-client-denied-by-server-configuration

From what I understand from the various error messages, there is a configuration problem with apache, but mainly with the domain used to join the server.

Could you share your Apache config?

Hi,

Looking at your Logs the following caught my attention:

=> are you using a self signed certificate? If yes, have a look here how to get rid if that warning

=> This might be indicative of a faulty module (either buggy or damaged file) that is being loaded during startup. Try to reinstall Apache2 + PHP modules. It might help.

I also recommend to update Apache + PHP to newest versions. Doing so skips the step of reinstalling it & makes your installation more secure (if you are exposing your Nextcloud instance to the public internet you should run the update immediately).

Hope this helps

There you go:

# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#	/etc/apache2/
#	|-- apache2.conf
#	|	`--  ports.conf
#	|-- mods-enabled
#	|	|-- *.load
#	|	`-- *.conf
#	|-- conf-enabled
#	|	`-- *.conf
# 	`-- sites-enabled
#	 	`-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#

DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 21600

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>

<Directory /usr/share>
	AllowOverride None
	Require all granted
</Directory>

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride All
	Require all granted
</Directory>

#<Directory /srv/>
#	Options Indexes FollowSymLinks
#	AllowOverride None
#	Require all granted
#</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
	Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
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

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
ServerName wookiee

Is there an update for PHP and Apache? Doesn’t seem to show while updating Ubuntu

Can you modify this post with the code balise ?
It’s more simply to read and debug :slight_smile:

Oops sorry )))

1 Like

For Apache it’s 2.4.59 and PHP 8.1.29

I don’t use Ubuntu therefore cannot point you to respective repositories but I’m 100% confident that they offer a repository with up-to-date versions of Apache & PHP.

Also consider upgrading PHP 8.3 (NC 28 supports it)

Yes. I checked the latest versions and you are right. I am not very sure how to proceed on the working server, though - these versions haven’t made it to the stable channel for Ubuntu Server and it can bork things up… But thanks for pointing me in the right direction.