git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFH/PATCH 0/4] git http tests with apache 2.4
@ 2013-06-09  8:07 Jeff King
  2013-06-09  8:07 ` [PATCH 1/4] t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4 Jeff King
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Jeff King @ 2013-06-09  8:07 UTC (permalink / raw)
  To: git

Apache 2.4 recently shipped in Debian unstable, and I noticed that all
of the git httpd tests stopped working. It turns out that some
configuration directives have changed between 2.2 and 2.4, and the httpd
server would not start at all.

With this series, the tests run again (for me, at least). The
"<IfVersion>" checks hopefully mean that there are no regressions for
people running 2.2 and lower.

However, the final patch is very unsatisfactory. We have to pick an MPM
module to mention in the config, but we don't have any idea what's
available. I suspect what I have provided will work on most Unix-ish
systems. Under Windows, there is a totally different MPM. But I am not
sure that our http tests run at all on Windows, as we seem to check in
lib-httpd.sh for a Unix-ish apache module path.

As far as I know, Apache does not have a "try to load this module and
fallback" directive. We could perhaps look in the module directory and
try to do something clever in the shell before starting Apache. Advice
from Apache gurus is welcome.

  [1/4]: t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4
  [2/4]: t/lib-httpd/apache.conf: load extra auth modules in apache 2.4
  [3/4]: t/lib-httpd/apache.conf: load compat access module in apache 2.4
  [4/4]: t/lib-httpd/apache.conf: configure an MPM module for apache 2.4

-Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4
  2013-06-09  8:07 [RFH/PATCH 0/4] git http tests with apache 2.4 Jeff King
@ 2013-06-09  8:07 ` Jeff King
  2013-06-09  8:08 ` [PATCH 2/4] t/lib-httpd/apache.conf: load extra auth modules in apache 2.4 Jeff King
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2013-06-09  8:07 UTC (permalink / raw)
  To: git

The LockFile directive from earlier versions of apache has
been replaced by the Mutex directive. The latter seems to
give sane defaults and does not need any specific
customization, so we can get away with just adding a version
check to the use of LockFile.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-httpd/apache.conf | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index b5bce45..38699bb 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -1,5 +1,7 @@ LockFile accept.lock
 ServerName dummy
+<IfVersion < 2.4>
 LockFile accept.lock
+</IfVersion>
 PidFile httpd.pid
 DocumentRoot www
 LogFormat "%h %l %u %t \"%r\" %>s %b" common
-- 
1.8.3.rc2.14.g7eee6b3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] t/lib-httpd/apache.conf: load extra auth modules in apache 2.4
  2013-06-09  8:07 [RFH/PATCH 0/4] git http tests with apache 2.4 Jeff King
  2013-06-09  8:07 ` [PATCH 1/4] t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4 Jeff King
@ 2013-06-09  8:08 ` Jeff King
  2013-06-09  8:08 ` [PATCH 3/4] t/lib-httpd/apache.conf: load compat access module " Jeff King
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2013-06-09  8:08 UTC (permalink / raw)
  To: git

In apache 2.4, the "Auth*" and "Require" directives have
moved into the authn_core and authz_core modules,
respectively.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-httpd/apache.conf | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 38699bb..1d3615b 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -47,6 +47,15 @@ ErrorLog error.log
 </IfModule>
 </IfVersion>
 
+<IfVersion >= 2.4>
+<IfModule !mod_authn_core.c>
+	LoadModule authn_core_module modules/mod_authn_core.so
+</IfModule>
+<IfModule !mod_authz_core.c>
+	LoadModule authz_core_module modules/mod_authz_core.so
+</IfModule>
+</IfVersion>
+
 PassEnv GIT_VALGRIND
 PassEnv GIT_VALGRIND_OPTIONS
 
-- 
1.8.3.rc2.14.g7eee6b3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] t/lib-httpd/apache.conf: load compat access module in apache 2.4
  2013-06-09  8:07 [RFH/PATCH 0/4] git http tests with apache 2.4 Jeff King
  2013-06-09  8:07 ` [PATCH 1/4] t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4 Jeff King
  2013-06-09  8:08 ` [PATCH 2/4] t/lib-httpd/apache.conf: load extra auth modules in apache 2.4 Jeff King
@ 2013-06-09  8:08 ` Jeff King
  2013-06-09  8:09 ` [PATCH 4/4] t/lib-httpd/apache.conf: configure an MPM module for " Jeff King
  2013-06-14 17:32 ` [RFH/PATCH 0/4] git http tests with " Junio C Hamano
  4 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2013-06-09  8:08 UTC (permalink / raw)
  To: git

In apache 2.4, the "Order" directive has gone away in favor
of a new system in mod_authz_host. However, since we want
our config file to remain compatible across multiple Apache
versions, we can use mod_access_compat to keep using the
older style.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-httpd/apache.conf | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 1d3615b..4883b8c 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -54,6 +54,9 @@ ErrorLog error.log
 <IfModule !mod_authz_core.c>
 	LoadModule authz_core_module modules/mod_authz_core.so
 </IfModule>
+<IfModule !mod_access_compat.c>
+	LoadModule access_compat_module modules/mod_access_compat.so
+</IfModule>
 </IfVersion>
 
 PassEnv GIT_VALGRIND
-- 
1.8.3.rc2.14.g7eee6b3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] t/lib-httpd/apache.conf: configure an MPM module for apache 2.4
  2013-06-09  8:07 [RFH/PATCH 0/4] git http tests with apache 2.4 Jeff King
                   ` (2 preceding siblings ...)
  2013-06-09  8:08 ` [PATCH 3/4] t/lib-httpd/apache.conf: load compat access module " Jeff King
@ 2013-06-09  8:09 ` Jeff King
  2013-06-14 17:32 ` [RFH/PATCH 0/4] git http tests with " Junio C Hamano
  4 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2013-06-09  8:09 UTC (permalink / raw)
  To: git

Versions of Apache before 2.4 always had a "MultiProcessing
Module" (MPM) statically built in, which manages the worker
threads/processes. We do not care which one, as it is
largely a performance issue, and we put only a light load on
the server during our testing.

As of Apache 2.4, the MPM module is loadable just like any
other module, but exactly one such module must be loaded. On
a system where the MPMs are compiled dynamically (e.g.,
Debian unstable), this means that our test Apache server
will not start unless we provide the appropriate
configuration.

Unfortunately, we do not actually know which MPM modules are
available or appropriate for the system on which the tests
are running. This patch picks the "prefork" module, as it
is likely to be available on all Unix-like systems.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-httpd/apache.conf | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 4883b8c..56ae548 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -57,6 +57,9 @@ ErrorLog error.log
 <IfModule !mod_access_compat.c>
 	LoadModule access_compat_module modules/mod_access_compat.so
 </IfModule>
+<IfModule !mod_mpm_prefork.c>
+	LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
+</IfModule>
 </IfVersion>
 
 PassEnv GIT_VALGRIND
-- 
1.8.3.rc2.14.g7eee6b3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RFH/PATCH 0/4] git http tests with apache 2.4
  2013-06-09  8:07 [RFH/PATCH 0/4] git http tests with apache 2.4 Jeff King
                   ` (3 preceding siblings ...)
  2013-06-09  8:09 ` [PATCH 4/4] t/lib-httpd/apache.conf: configure an MPM module for " Jeff King
@ 2013-06-14 17:32 ` Junio C Hamano
  2013-06-14 21:58   ` Jeff King
  4 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2013-06-14 17:32 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Jeff King <peff@peff.net> writes:

> Apache 2.4 recently shipped in Debian unstable, and I noticed that all
> of the git httpd tests stopped working. It turns out that some
> configuration directives have changed between 2.2 and 2.4, and the httpd
> server would not start at all.
>
> With this series, the tests run again (for me, at least). The
> "<IfVersion>" checks hopefully mean that there are no regressions for
> people running 2.2 and lower.
>
> However, the final patch is very unsatisfactory. We have to pick an MPM
> module to mention in the config, but we don't have any idea what's
> available. I suspect what I have provided will work on most Unix-ish
> systems. Under Windows, there is a totally different MPM. But I am not
> sure that our http tests run at all on Windows, as we seem to check in
> lib-httpd.sh for a Unix-ish apache module path.

Thanks.  I think the final one, while it may be unsatisfactory, is a
reasonable (or "least bad") compromise, at least for now.  I do not
think of a better way, without adding "if you want customization,
write a snippet to be included in the configuration used during the
test", which feels way overkill.
>
> As far as I know, Apache does not have a "try to load this module and
> fallback" directive. We could perhaps look in the module directory and
> try to do something clever in the shell before starting Apache. Advice
> from Apache gurus is welcome.
>
>   [1/4]: t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4
>   [2/4]: t/lib-httpd/apache.conf: load extra auth modules in apache 2.4
>   [3/4]: t/lib-httpd/apache.conf: load compat access module in apache 2.4
>   [4/4]: t/lib-httpd/apache.conf: configure an MPM module for apache 2.4
>
> -Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFH/PATCH 0/4] git http tests with apache 2.4
  2013-06-14 17:32 ` [RFH/PATCH 0/4] git http tests with " Junio C Hamano
@ 2013-06-14 21:58   ` Jeff King
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2013-06-14 21:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Fri, Jun 14, 2013 at 10:32:57AM -0700, Junio C Hamano wrote:

> > However, the final patch is very unsatisfactory. We have to pick an MPM
> > module to mention in the config, but we don't have any idea what's
> > available. I suspect what I have provided will work on most Unix-ish
> > systems. Under Windows, there is a totally different MPM. But I am not
> > sure that our http tests run at all on Windows, as we seem to check in
> > lib-httpd.sh for a Unix-ish apache module path.
> 
> Thanks.  I think the final one, while it may be unsatisfactory, is a
> reasonable (or "least bad") compromise, at least for now.  I do not
> think of a better way, without adding "if you want customization,
> write a snippet to be included in the configuration used during the
> test", which feels way overkill.

Yeah, we may have to go there. My feeling on it (and why I posted it
as-is) is that it improves the situation for some people, and should be
no worse for anyone else. Therefore people who are on 2.4 and are still
broken after this series can speak up and show us the exact breakage and
fix they need without us having to guess.

-Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-14 21:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-09  8:07 [RFH/PATCH 0/4] git http tests with apache 2.4 Jeff King
2013-06-09  8:07 ` [PATCH 1/4] t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4 Jeff King
2013-06-09  8:08 ` [PATCH 2/4] t/lib-httpd/apache.conf: load extra auth modules in apache 2.4 Jeff King
2013-06-09  8:08 ` [PATCH 3/4] t/lib-httpd/apache.conf: load compat access module " Jeff King
2013-06-09  8:09 ` [PATCH 4/4] t/lib-httpd/apache.conf: configure an MPM module for " Jeff King
2013-06-14 17:32 ` [RFH/PATCH 0/4] git http tests with " Junio C Hamano
2013-06-14 21:58   ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).