From fcdebf6891b705bb54b35535521158da930ffa05 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 21 Jan 2025 20:05:15 -0800 Subject: [PATCH] Some systems use the event MPM instead of prefork https://github.com/webmin/webmin/issues/2365 --- apache/apache-lib.pl | 10 +++++----- apache/mod_mpm_event.pl | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100755 apache/mod_mpm_event.pl diff --git a/apache/apache-lib.pl b/apache/apache-lib.pl index 7de3be823..a9adc3869 100755 --- a/apache/apache-lib.pl +++ b/apache/apache-lib.pl @@ -826,21 +826,21 @@ return $_[0] ? $_[0] : $_[1]; } # make_directives(ref, version, module) +# Return directives suitable for this system and version sub make_directives { -local(@rv, $aref); -$aref = $_[0]; -local $ver = $_[1]; +my ($aref, $ver, $mod) = @_; +my @rv; if ($ver =~ /^(1)\.(3)(\d+)$/) { $ver = sprintf "%d.%d%2.2d", $1, $2, $3; } -foreach $d (@$aref) { +foreach my $d (@$aref) { local(%dir); $dir{'name'} = $d->[0]; $dir{'multiple'} = $d->[1]; $dir{'type'} = int($d->[2]); $dir{'subtype'} = $d->[2] - $dir{'type'}; - $dir{'module'} = $_[2]; + $dir{'module'} = $mod; $dir{'version'} = $ver; $dir{'priority'} = $d->[5]; foreach $c (split(/\s+/, $d->[3])) { $dir{$c}++; } diff --git a/apache/mod_mpm_event.pl b/apache/mod_mpm_event.pl new file mode 100755 index 000000000..b70094ad2 --- /dev/null +++ b/apache/mod_mpm_event.pl @@ -0,0 +1,24 @@ +# mod_mpm_event.pl +# Defines editors for the pre-forking module in apache 2.4. +# The actual functions for all of these are still in core.pl + +sub mod_mpm_event_directives +{ +local $rv; +$rv = [ [ 'CoreDumpDirectory', 0, 9, 'global', 2.0 ], + [ 'BindAddress Listen Port', 1, 1, 'global', 2.0, 10 ], + [ 'ListenBacklog', 0, 1, 'global', 2.0 ], + [ 'LockFile', 0, 9, 'global', 2.0 ], + [ 'MaxRequestsPerChild', 0, 0, 'global', 2.0 ], + [ 'MinSpareServers', 0, 0, 'global', 2.0 ], + [ 'MaxSpareServers', 0, 0, 'global', 2.0 ], + [ 'PidFile', 0, 9, 'global', 2.0 ], + [ 'ScoreBoardFile', 0, 9, 'global', 2.0 ], + [ 'SendBufferSize', 0, 1, 'global', 2.0 ], + [ 'StartServers', 0, 0, 'global', 2.0 ], + [ 'Group', 0, 8, 'global', 2.0 ], + [ 'User', 0, 8, 'global', 2.0, 10 ] ]; +return &make_directives($rv, $_[0], "mod_mpm_event"); +} + +