Skip to content

Commit

Permalink
apache httpd: some fixes
Browse files Browse the repository at this point in the history
- Allow running as UID 0
- Fix log directory
- Enable asis and cgi modules

Fixes haikuports#11114
  • Loading branch information
pulkomandy committed Sep 14, 2024
1 parent fba38d7 commit dbf8105
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 4 deletions.
5 changes: 3 additions & 2 deletions www-servers/apache/apache-2.4.57.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ and freely-available source code implementation of an HTTP (Web) server"
HOMEPAGE="https://httpd.apache.org/"
COPYRIGHT="1995-2022 The Apache Software Foundation."
LICENSE="Apache v2"
REVISION="2"
REVISION="3"
SOURCE_URI="https://archive.apache.org/dist/httpd/httpd-$portVersion.tar.bz2"
CHECKSUM_SHA256="dbccb84aee95e095edfbb81e5eb926ccd24e6ada55dcd83caecb262e5cf94d2a"
SOURCE_DIR="httpd-$portVersion"
Expand Down Expand Up @@ -320,7 +320,8 @@ BUILD()
--libexecdir="$libDir"/apache \
--sysconfdir="$sysconfDir"/apache \
--with-apr=/$relativeBinDir \
--with-apr-util=/$relativeBinDir
--with-apr-util=/$relativeBinDir \
--enable-asis --enable-cgi
make $jobArgs
}

Expand Down
91 changes: 89 additions & 2 deletions www-servers/apache/patches/apache-2.4.57.patchset
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 1a98f3d31992dbbed2e52d22cb017ad6d755a68a Mon Sep 17 00:00:00 2001
From 00d6a023a4b5a20975e2f35aad44e2a93ab71c02 Mon Sep 17 00:00:00 2001
From: Nav <[email protected]>
Date: Mon, 15 Dec 2014 16:39:31 +0000
Subject: Fixed redefinition error
Expand All @@ -18,5 +18,92 @@ index 8111877..35323c6 100644
# If export_files is a dependency here, but we remove it during this stage,
# when exports.c is generated, make will not detect that export_files is no
--
2.37.3
2.45.2


From c6a174d888ae0a5e33e8f0233f9658400882a7e5 Mon Sep 17 00:00:00 2001
From: PulkoMandy <[email protected]>
Date: Sat, 14 Sep 2024 16:12:28 +0200
Subject: Disable uid check on Haiku

User 0 is a normal user and does not have specific permissions in Haiku.

diff --git a/modules/arch/unix/mod_unixd.c b/modules/arch/unix/mod_unixd.c
index 1baa278..15886e7 100644
--- a/modules/arch/unix/mod_unixd.c
+++ b/modules/arch/unix/mod_unixd.c
@@ -214,7 +214,7 @@ unixd_set_user(cmd_parms *cmd, void *dummy,

ap_unixd_config.user_name = arg;
ap_unixd_config.user_id = ap_uname2id(arg);
-#if !defined (BIG_SECURITY_HOLE) && !defined (OS2)
+#if !defined (BIG_SECURITY_HOLE) && !defined (OS2) && !defined(__HAIKU__)
if (ap_unixd_config.user_id == 0) {
return "Error:\tApache has not been designed to serve pages while\n"
"\trunning as root. There are known race conditions that\n"
--
2.45.2


From 171719a2021b650d2c01a56d3f20a913028d9862 Mon Sep 17 00:00:00 2001
From: PulkoMandy <[email protected]>
Date: Sat, 14 Sep 2024 16:33:12 +0200
Subject: Fix log directory


diff --git a/config.layout b/config.layout
index a29351e..b12dc09 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>

@@ -174,7 +174,7 @@
includedir: ${prefix}/include
localstatedir: /var${prefix}
runtimedir: ${localstatedir}/run
- logfiledir: ${localstatedir}/logs
+ logfiledir: ${localstatedir}/log
proxycachedir: ${localstatedir}/proxy
</Layout>

@@ -246,7 +246,7 @@
includedir: ${exec_prefix}/include
localstatedir: ${prefix}
runtimedir: /var/run
- logfiledir: ${datadir}/logs
+ logfiledir: ${datadir}/log
proxycachedir: ${datadir}/proxy
</Layout>

@@ -269,8 +269,8 @@
cgidir: ${prefix}/cgi-bin
includedir: ${exec_prefix}/lib/apache/include
localstatedir: ${prefix}
- runtimedir: ${prefix}/logs
- logfiledir: ${prefix}/logs
+ runtimedir: ${prefix}/log
+ logfiledir: ${prefix}/log
proxycachedir: ${prefix}/proxy
</Layout>

@@ -367,7 +367,7 @@
includedir: ${prefix}/include
localstatedir: /var/httpd
runtimedir: ${localstatedir}/run
- logfiledir: ${localstatedir}/logs
+ logfiledir: ${localstatedir}/log
proxycachedir: ${localstatedir}/proxy
</Layout>

--
2.45.2

0 comments on commit dbf8105

Please sign in to comment.