package/apache: add option to disable server
PATCH v5 1/1 package/apache: add option to disable server
From: Giulio Benetti <[email protected]>
Other packages (e.g. mongoose) can use htdigest and htpasswd, but those are only available with apache.
We don't want to build the whole apache server just for those tools, so we add an option to disable the server; it is enabled by default for legacy purposes (so that existing (def)configs still work).
However, there is no way to tell the apache buildsystem to only build those two tools, so we have to provide custom build and install commands.
---V1->V2:
* Hide "External Apache modules" if BR2_PACKAGE_APACHE_UTILS_ONLY is enabled V2->V3:
as suggested by Arnout:
* change negative option BR2_PACKAGE_APACHE_UTILS_ONLY to BR2_PACKAGE_APACHE_DAEMON
* set a common APACHE_CONF_OPTS and only add specific options for BR2_PACKAGE_APACHE_DAEMON enabled or notV3->V4:
* drop --with-static-* options as suggested by ArnoutV4->V5:
as suggested by Yann:
* drop BR2_PACKAGE_APACHE check in package/Config.in for package/modsecurity2/Config.in
* make BR2_PACKAGE_PHP_SAPI_APACHE depends on BR2_PACKAGE_APACHE_DAEMON
* improve commit log
--- package/Config.in | 2 -- package/apache/Config.in | 9 +++++++++ package/apache/apache.mk | 20 +++++++++++++++++--- package/modsecurity2/Config.in | 2 +- package/php/Config.in | 2 +- 5 files changed, 28 insertions(+), 7 deletions(-)
package/Config.in +0 -2
@@ -2279,11 +2279,9 @@ menu "Networking applications" source "package/alfred/Config.in" source "package/aoetools/Config.in" source "package/apache/Config.in" -if BR2_PACKAGE_APACHE menu "External Apache modules" source "package/modsecurity2/Config.in" endmenu -endif source "package/argus/Config.in" source "package/arp-scan/Config.in" source "package/arptables/Config.in"
package/apache/Config.in +9 -0
@@ -17,6 +17,14 @@ config BR2_PACKAGE_APACHE if BR2_PACKAGE_APACHE +config BR2_PACKAGE_APACHE_DAEMON + bool "apache-daemon" + default y + help + Provide entire Apache daemon, otherwise only htdigest and htpasswd + will be built and installed. + +if BR2_PACKAGE_APACHE_DAEMON choice prompt "Multi-Processing Module (MPM)" default BR2_PACKAGE_APACHE_MPM_WORKER
@@ -40,6 +48,7 @@ config BR2_PACKAGE_APACHE_MPM_WORKER Implements a hybrid multi-threaded multi-process web server endchoice +endif endif
package/apache/apache.mk +17 -3
@@ -12,8 +12,6 @@ APACHE_LICENSE_FILES = LICENSE APACHE_CPE_ID_VENDOR = apache APACHE_CPE_ID_PRODUCT = http_server APACHE_SELINUX_MODULES = apache -# Needed for mod_php -APACHE_INSTALL_STAGING = YES # We have a patch touching configure.in and Makefile.in, # so we need to autoreconf: APACHE_AUTORECONF = YES
@@ -32,10 +30,16 @@ APACHE_MPM = worker endif APACHE_CONF_OPTS = \ - --sysconfdir=/etc/apache2 \ --with-apr=$(STAGING_DIR)/usr \ --with-apr-util=$(STAGING_DIR)/usr \ --with-pcre=$(STAGING_DIR)/usr/bin/pcre2-config \ + +ifeq ($(BR2_PACKAGE_APACHE_DAEMON),y) +# Needed for mod_php +APACHE_INSTALL_STAGING = YES + +APACHE_CONF_OPTS += \ + --sysconfdir=/etc/apache2 \ --enable-http \ --enable-dbd \ --enable-proxy \
@@ -121,5 +125,15 @@ define APACHE_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 644 package/apache/apache.service \ $(TARGET_DIR)/usr/lib/systemd/system/apache.service endef +else +define APACHE_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/support htdigest htpasswd +endef + +define APACHE_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 -D $(@D)/support/htdigest $(TARGET_DIR)/usr/bin/htdigest + $(INSTALL) -m 0755 -D $(@D)/support/htpasswd $(TARGET_DIR)/usr/bin/htpasswd +endef +endif $(eval $(autotools-package))
package/modsecurity2/Config.in +1 -1
@@ -1,6 +1,6 @@ config BR2_PACKAGE_MODSECURITY2 bool "modsecurity2" - depends on BR2_PACKAGE_APACHE + depends on BR2_PACKAGE_APACHE_DAEMON select BR2_PACKAGE_LIBXML2 select BR2_PACKAGE_PCRE2 help
package/php/Config.in +1 -1
@@ -36,7 +36,7 @@ if BR2_PACKAGE_PHP config BR2_PACKAGE_PHP_SAPI_APACHE bool "Apache interface" - depends on BR2_PACKAGE_APACHE + depends on BR2_PACKAGE_APACHE_DAEMON help Apache module
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Giulio,
Le 22/09/2023 à 23:18, Giulio Benetti a écrit :
Quoted 77 lines
From: Giulio Benetti <[email protected]>
Other packages (e.g. mongoose) can use htdigest and htpasswd, but those are only available with apache.
We don't want to build the whole apache server just for those tools, so we add an option to disable the server; it is enabled by default for legacy purposes (so that existing (def)configs still work).
However, there is no way to tell the apache buildsystem to only build those two tools, so we have to provide custom build and install commands.
Cc Jim Reinhart <[email protected]>Cc James Autry <[email protected]>Cc Matthew Maron <[email protected]>Signed-off-by Giulio Benetti <[email protected]>---
V1->V2:
* Hide "External Apache modules" ifBR2_PACKAGE_APACHE_UTILS_ONLYis enabledV2->V3:
as suggested by Arnout:
* change negative optionBR2_PACKAGE_APACHE_UTILS_ONLYtoBR2_PACKAGE_APACHE_DAEMON
* set a commonAPACHE_CONF_OPTSand only add specific options forBR2_PACKAGE_APACHE_DAEMONenabled or notV3->V4:
* drop --with-static-* options as suggested by ArnoutV4->V5:
as suggested by Yann:
* dropBR2_PACKAGE_APACHEcheck in package/Config.in for package/modsecurity2/Config.in
* makeBR2_PACKAGE_PHP_SAPI_APACHEdepends onBR2_PACKAGE_APACHE_DAEMON
* improve commit log--- package/Config.in | 2 -- package/apache/Config.in | 9 +++++++++ package/apache/apache.mk | 20 +++++++++++++++++--- package/modsecurity2/Config.in | 2 +- package/php/Config.in | 2 +- 5 files changed, 28 insertions(+), 7 deletions(-)package/Config.in +0
-2@@ -2279,11 +2279,9 @@ menu "Networking applications" source "package/alfred/Config.in" source "package/aoetools/Config.in" source "package/apache/Config.in" -if BR2_PACKAGE_APACHE menu "External Apache modules" source "package/modsecurity2/Config.in" endmenu -endif source "package/argus/Config.in" source "package/arp-scan/Config.in" source "package/arptables/Config.in"package/apache/Config.in +8
-0@@ -17,6 +17,14 @@ config BR2_PACKAGE_APACHE if BR2_PACKAGE_APACHE +config BR2_PACKAGE_APACHE_DAEMON + bool "apache-daemon" + default y + help + Provide entire Apache daemon, otherwise only htdigest and htpasswd + will be built and installed. + +if BR2_PACKAGE_APACHE_DAEMON choice prompt "Multi-Processing Module (MPM)" default BR2_PACKAGE_APACHE_MPM_WORKER
package/apache/Config.in config BR2_PACKAGE_APACHE_MPM_WORKER · line 48
Quoted 1 line
package/apache/Config.in +0
-0@@ -40,6 +48,7 @@ config BR2_PACKAGE_APACHE_MPM_WORKER Implements a hybrid multi-threaded multi-process web server
What about apparmor package? package/apparmor/apparmor.mk:ifeq ($(BR2_PACKAGE_APACHE),y)
it seems we need to use BR2_PACKAGE_APACHE_DAEMON with this change.
Best regards,
Romain
Quoted 70 lines
package/apache/Config.in +1
-0endchoice +endif endifpackage/apache/apache.mk +17
-3@@ -12,8 +12,6 @@ APACHE_LICENSE_FILES = LICENSE APACHE_CPE_ID_VENDOR = apache APACHE_CPE_ID_PRODUCT = http_server APACHE_SELINUX_MODULES = apache -# Needed for mod_php -APACHE_INSTALL_STAGING = YES # We have a patch touching configure.in and Makefile.in, # so we need to autoreconf: APACHE_AUTORECONF = YES@@ -32,10 +30,16 @@ APACHE_MPM = worker endif APACHE_CONF_OPTS = \ - --sysconfdir=/etc/apache2 \ --with-apr=$(STAGING_DIR)/usr \ --with-apr-util=$(STAGING_DIR)/usr \ --with-pcre=$(STAGING_DIR)/usr/bin/pcre2-config \ + +ifeq ($(BR2_PACKAGE_APACHE_DAEMON),y) +# Needed for mod_php +APACHE_INSTALL_STAGING = YES + +APACHE_CONF_OPTS += \ + --sysconfdir=/etc/apache2 \ --enable-http \ --enable-dbd \ --enable-proxy \@@ -121,5 +125,15 @@ define APACHE_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 644 package/apache/apache.service \ $(TARGET_DIR)/usr/lib/systemd/system/apache.service endef +else +define APACHE_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/support htdigest htpasswd +endef + +define APACHE_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 -D $(@D)/support/htdigest $(TARGET_DIR)/usr/bin/htdigest + $(INSTALL) -m 0755 -D $(@D)/support/htpasswd $(TARGET_DIR)/usr/bin/htpasswd +endef +endif $(eval $(autotools-package))package/modsecurity2/Config.in +1
-1@@ -1,6 +1,6 @@ config BR2_PACKAGE_MODSECURITY2 bool "modsecurity2" - depends on BR2_PACKAGE_APACHE + depends on BR2_PACKAGE_APACHE_DAEMON select BR2_PACKAGE_LIBXML2 select BR2_PACKAGE_PCRE2 helppackage/php/Config.in +0
-0
package/php/Config.in if BR2_PACKAGE_PHP · line 42
Quoted 8 lines
package/php/Config.in +1
-1@@ -36,7 +36,7 @@ if BR2_PACKAGE_PHP config BR2_PACKAGE_PHP_SAPI_APACHE bool "Apache interface" - depends on BR2_PACKAGE_APACHE + depends on BR2_PACKAGE_APACHE_DAEMON help Apache module
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Romain,
Quoted 85 lines · Romain Naour
Hello Giulio,
Le 22/09/2023 à 23:18, Giulio Benetti a écrit :
Quoted 77 lines
From: Giulio Benetti <[email protected]>
Other packages (e.g. mongoose) can use htdigest and htpasswd, but those are only available with apache.
We don't want to build the whole apache server just for those tools, so we add an option to disable the server; it is enabled by default for legacy purposes (so that existing (def)configs still work).
However, there is no way to tell the apache buildsystem to only build those two tools, so we have to provide custom build and install commands.
Cc Jim Reinhart <[email protected]>Cc James Autry <[email protected]>Cc Matthew Maron <[email protected]>Signed-off-by Giulio Benetti <[email protected]>---
V1->V2:
* Hide "External Apache modules" ifBR2_PACKAGE_APACHE_UTILS_ONLYis enabledV2->V3:
as suggested by Arnout:
* change negative optionBR2_PACKAGE_APACHE_UTILS_ONLYtoBR2_PACKAGE_APACHE_DAEMON
* set a commonAPACHE_CONF_OPTSand only add specific options forBR2_PACKAGE_APACHE_DAEMONenabled or notV3->V4:
* drop --with-static-* options as suggested by ArnoutV4->V5:
as suggested by Yann:
* dropBR2_PACKAGE_APACHEcheck in package/Config.in for package/modsecurity2/Config.in
* makeBR2_PACKAGE_PHP_SAPI_APACHEdepends onBR2_PACKAGE_APACHE_DAEMON
* improve commit log--- package/Config.in | 2 -- package/apache/Config.in | 9 +++++++++ package/apache/apache.mk | 20 +++++++++++++++++--- package/modsecurity2/Config.in | 2 +- package/php/Config.in | 2 +- 5 files changed, 28 insertions(+), 7 deletions(-)package/Config.in +0
-2@@ -2279,11 +2279,9 @@ menu "Networking applications" source "package/alfred/Config.in" source "package/aoetools/Config.in" source "package/apache/Config.in" -if BR2_PACKAGE_APACHE menu "External Apache modules" source "package/modsecurity2/Config.in" endmenu -endif source "package/argus/Config.in" source "package/arp-scan/Config.in" source "package/arptables/Config.in"package/apache/Config.in +8
-0@@ -17,6 +17,14 @@ config BR2_PACKAGE_APACHE if BR2_PACKAGE_APACHE +config BR2_PACKAGE_APACHE_DAEMON + bool "apache-daemon" + default y + help + Provide entire Apache daemon, otherwise only htdigest and htpasswd + will be built and installed. + +if BR2_PACKAGE_APACHE_DAEMON choice prompt "Multi-Processing Module (MPM)" default BR2_PACKAGE_APACHE_MPM_WORKERpackage/apache/Config.in config BR2_PACKAGE_APACHE_MPM_WORKER · line 48
Quoted 1 line
package/apache/Config.in +0
-0@@ -40,6 +48,7 @@ config BR2_PACKAGE_APACHE_MPM_WORKER Implements a hybrid multi-threaded multi-process web serverWhat about apparmor package? package/apparmor/apparmor.mk:ifeq ($(BR2_PACKAGE_APACHE),y)
Quoted 1 line
it seems we need to use
BR2_PACKAGE_APACHE_DAEMONwith this change.
you're totally right. Just sent v6 with that change:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
Thank you!
Best regards
Signature · 2 lines
Giulio Benetti CEO&CTO@Benetti Engineering sas
Quoted 75 lines
Best regards,
RomainQuoted 71 lines
package/apache/Config.in +1
-0endchoice +endif endifpackage/apache/apache.mk +17
-3@@ -12,8 +12,6 @@ APACHE_LICENSE_FILES = LICENSE APACHE_CPE_ID_VENDOR = apache APACHE_CPE_ID_PRODUCT = http_server APACHE_SELINUX_MODULES = apache -# Needed for mod_php -APACHE_INSTALL_STAGING = YES # We have a patch touching configure.in and Makefile.in, # so we need to autoreconf: APACHE_AUTORECONF = YES@@ -32,10 +30,16 @@ APACHE_MPM = worker endif APACHE_CONF_OPTS = \ - --sysconfdir=/etc/apache2 \ --with-apr=$(STAGING_DIR)/usr \ --with-apr-util=$(STAGING_DIR)/usr \ --with-pcre=$(STAGING_DIR)/usr/bin/pcre2-config \ + +ifeq ($(BR2_PACKAGE_APACHE_DAEMON),y) +# Needed for mod_php +APACHE_INSTALL_STAGING = YES + +APACHE_CONF_OPTS += \ + --sysconfdir=/etc/apache2 \ --enable-http \ --enable-dbd \ --enable-proxy \@@ -121,5 +125,15 @@ define APACHE_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 644 package/apache/apache.service \ $(TARGET_DIR)/usr/lib/systemd/system/apache.service endef +else +define APACHE_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/support htdigest htpasswd +endef + +define APACHE_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 -D $(@D)/support/htdigest $(TARGET_DIR)/usr/bin/htdigest + $(INSTALL) -m 0755 -D $(@D)/support/htpasswd $(TARGET_DIR)/usr/bin/htpasswd +endef +endif $(eval $(autotools-package))package/modsecurity2/Config.in +1
-1@@ -1,6 +1,6 @@ config BR2_PACKAGE_MODSECURITY2 bool "modsecurity2" - depends on BR2_PACKAGE_APACHE + depends on BR2_PACKAGE_APACHE_DAEMON select BR2_PACKAGE_LIBXML2 select BR2_PACKAGE_PCRE2 helppackage/php/Config.in +0
-0@@ -36,7 +36,7 @@ if BR2_PACKAGE_PHP
Quoted 12 lines
package/php/Config.in if BR2_PACKAGE_PHP · line 42
Quoted 7 lines
package/php/Config.in +1
-1config BR2_PACKAGE_PHP_SAPI_APACHE bool "Apache interface" - depends on BR2_PACKAGE_APACHE + depends on BR2_PACKAGE_APACHE_DAEMON help Apache module_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot