Files
buildroot/package/apache/apache.service
Fiona Klute 1006666f67 package/apache: use "Debian" filesystem layout to fix read-only rootfs
The previous configuration placed both logs and PID file in /var/logs,
which is not writable with a read-only rootfs (e.g. squashfs), as well
as non-standard. Starting HTTPD during boot failed with:

(30)Read-only file system: AH00091: httpd: could not open error log file /var/logs/error_log.
AH00015: Unable to open logs

An additional issue was that the Buildroot-default --prefix=/usr
override meant various Apache-internal directories (e.g. htdocs) were
placed directly in /usr. Note that the upstream default prefix is
/usr/local/apache2, not /usr/local.

Using the "Debian" layout provides a standard-compatible layout with
logs in /var/log/apache2 and PID file in /var/run/apache2 (both in
tmpfs with the default Buildroot fstab). Both directories need to
exist when the server starts, so handle that in the init script.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2026-08-16 16:49:59 +02:00

15 lines
304 B
Desktop File

[Unit]
Description=Apache HTTP Server
After=network.target
[Service]
Type=forking
ExecStartPre=/bin/mkdir -p /var/log/apache2 /var/run/apache2
ExecStart=/usr/bin/apachectl start
ExecReload=/usr/bin/apachectl graceful
ExecStop=/usr/bin/apachectl stop
Restart=always
[Install]
WantedBy=multi-user.target