BugFix: httpd.conf log location incorrect (#6004)

* BugFix: httpd.conf log location incorrect

The default config.layout being used with Mariner is Apache, which
points to non existent log directory. As a result the default httpd
config provided with Mariner has an error in it, preventing httpd
serivce from starting

* Adding RuntimeDirectory to ensure httpd dir exists for pid file
This commit is contained in:
AZaugg 2023-08-29 13:36:26 -04:00 коммит произвёл GitHub
Родитель e476484dc6
Коммит f0ef831100
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 24 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,15 @@
diff --git a/config.layout b/config.layout
index a29351ef14..2a1a4c81ef 100644
--- a/config.layout
+++ b/config.layout
@@ -28,8 +28,8 @@
cgidir: ${datadir}/cgi-bin
includedir: ${prefix}/include
localstatedir: ${prefix}
- runtimedir: ${localstatedir}/logs
- logfiledir: ${localstatedir}/logs
+ runtimedir: ${localstatedir}/log
+ logfiledir: ${localstatedir}/log
proxycachedir: ${localstatedir}/proxy
</Layout>

Просмотреть файл

@ -3,7 +3,7 @@
Summary: The Apache HTTP Server
Name: httpd
Version: 2.4.56
Release: 1%{?dist}
Release: 2%{?dist}
License: Apache-2.0
Vendor: Microsoft Corporation
Distribution: Mariner
@ -24,6 +24,7 @@ Source10: httpd-ssl-gencerts
# https://www.linuxfromscratch.org/patches/blfs/svn/httpd-2.4.56-blfs_layout-1.patch
Patch0: httpd-2.4.53-blfs_layout-3.patch
Patch1: httpd-uncomment-ServerName.patch
Patch2: httpd-fix-apache-layout-log-path.patch
# CVE-1999-0236 must be mitigated by the user. See "Server Side Includes" at https://httpd.apache.org/docs/2.4/misc/security_tips.html
Patch100: CVE-1999-0236.nopatch
@ -142,6 +143,7 @@ Security (TLS) protocols.
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
%configure \
@ -205,7 +207,8 @@ After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=%{_var}/run/httpd/httpd.pid
PIDFile=/run/httpd/httpd.pid
RuntimeDirectory=httpd
ExecStart=%{_sbindir}/httpd -k start
ExecStop=%{_sbindir}/httpd -k stop
ExecReload=%{_sbindir}/httpd -k graceful
@ -342,6 +345,10 @@ fi
%{_libexecdir}/httpd-ssl-pass-dialog
%changelog
* Wed Aug 16 2023 Andy Zaugg <azaugg@linkedin.com> - 2.4.56-1
- Patch config.layout and provide and provide a real log path
- Fix PIDfile reference to /run/httpd/httpd.pid
* Tue Mar 14 2023 Thien Trung Vuong <tvuong@microsoft.com> - 2.4.56-1
- Upgrade to version 2.4.56 - Fixes CVE-2023-27522, CVE-2023-25690