{"thread":{"id":"34072","subject":"[RFH/PATCH 0/4] git http tests with apache 2.4","startedAt":"2013-06-09T08:07:22Z","lastAt":"2013-06-14T21:58:01Z","messageCount":7,"participants":["Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"219942","messageId":"20130609080722.GA31699@sigill.intra.peff.net","threadId":"34072","inReplyTo":null,"subject":"[RFH/PATCH 0/4] git http tests with apache 2.4","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-09T08:07:22Z","receivedAt":"2013-06-09T08:07:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Apache 2.4 recently shipped in Debian unstable, and I noticed that all\nof the git httpd tests stopped working. It turns out that some\nconfiguration directives have changed between 2.2 and 2.4, and the httpd\nserver would not start at all.\n\nWith this series, the tests run again (for me, at least). The\n\"<IfVersion>\" checks hopefully mean that there are no regressions for\npeople running 2.2 and lower.\n\nHowever, the final patch is very unsatisfactory. We have to pick an MPM\nmodule to mention in the config, but we don't have any idea what's\navailable. I suspect what I have provided will work on most Unix-ish\nsystems. Under Windows, there is a totally different MPM. But I am not\nsure that our http tests run at all on Windows, as we seem to check in\nlib-httpd.sh for a Unix-ish apache module path.\n\nAs far as I know, Apache does not have a \"try to load this module and\nfallback\" directive. We could perhaps look in the module directory and\ntry to do something clever in the shell before starting Apache. Advice\nfrom Apache gurus is welcome.\n\n  [1/4]: t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4\n  [2/4]: t/lib-httpd/apache.conf: load extra auth modules in apache 2.4\n  [3/4]: t/lib-httpd/apache.conf: load compat access module in apache 2.4\n  [4/4]: t/lib-httpd/apache.conf: configure an MPM module for apache 2.4\n\n-Peff\n"},{"id":"219943","messageId":"20130609080759.GA32139@sigill.intra.peff.net","threadId":"34072","inReplyTo":"20130609080722.GA31699@sigill.intra.peff.net","subject":"[PATCH 1/4] t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-09T08:07:59Z","receivedAt":"2013-06-09T08:07:59Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The LockFile directive from earlier versions of apache has\nbeen replaced by the Mutex directive. The latter seems to\ngive sane defaults and does not need any specific\ncustomization, so we can get away with just adding a version\ncheck to the use of LockFile.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/lib-httpd/apache.conf | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nindex b5bce45..38699bb 100644\n--- a/t/lib-httpd/apache.conf\n+++ b/t/lib-httpd/apache.conf\n@@ -1,5 +1,7 @@ LockFile accept.lock\n ServerName dummy\n+<IfVersion < 2.4>\n LockFile accept.lock\n+</IfVersion>\n PidFile httpd.pid\n DocumentRoot www\n LogFormat \"%h %l %u %t \\\"%r\\\" %>s %b\" common\n-- \n1.8.3.rc2.14.g7eee6b3\n"},{"id":"219944","messageId":"20130609080822.GB32139@sigill.intra.peff.net","threadId":"34072","inReplyTo":"20130609080722.GA31699@sigill.intra.peff.net","subject":"[PATCH 2/4] t/lib-httpd/apache.conf: load extra auth modules in apache 2.4","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-09T08:08:22Z","receivedAt":"2013-06-09T08:08:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"In apache 2.4, the \"Auth*\" and \"Require\" directives have\nmoved into the authn_core and authz_core modules,\nrespectively.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/lib-httpd/apache.conf | 9 +++++++++\n 1 file changed, 9 insertions(+)\n\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nindex 38699bb..1d3615b 100644\n--- a/t/lib-httpd/apache.conf\n+++ b/t/lib-httpd/apache.conf\n@@ -47,6 +47,15 @@ ErrorLog error.log\n </IfModule>\n </IfVersion>\n \n+<IfVersion >= 2.4>\n+<IfModule !mod_authn_core.c>\n+\tLoadModule authn_core_module modules/mod_authn_core.so\n+</IfModule>\n+<IfModule !mod_authz_core.c>\n+\tLoadModule authz_core_module modules/mod_authz_core.so\n+</IfModule>\n+</IfVersion>\n+\n PassEnv GIT_VALGRIND\n PassEnv GIT_VALGRIND_OPTIONS\n \n-- \n1.8.3.rc2.14.g7eee6b3\n"},{"id":"219945","messageId":"20130609080845.GC32139@sigill.intra.peff.net","threadId":"34072","inReplyTo":"20130609080722.GA31699@sigill.intra.peff.net","subject":"[PATCH 3/4] t/lib-httpd/apache.conf: load compat access module in apache 2.4","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-09T08:08:45Z","receivedAt":"2013-06-09T08:08:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"In apache 2.4, the \"Order\" directive has gone away in favor\nof a new system in mod_authz_host. However, since we want\nour config file to remain compatible across multiple Apache\nversions, we can use mod_access_compat to keep using the\nolder style.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/lib-httpd/apache.conf | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nindex 1d3615b..4883b8c 100644\n--- a/t/lib-httpd/apache.conf\n+++ b/t/lib-httpd/apache.conf\n@@ -54,6 +54,9 @@ ErrorLog error.log\n <IfModule !mod_authz_core.c>\n \tLoadModule authz_core_module modules/mod_authz_core.so\n </IfModule>\n+<IfModule !mod_access_compat.c>\n+\tLoadModule access_compat_module modules/mod_access_compat.so\n+</IfModule>\n </IfVersion>\n \n PassEnv GIT_VALGRIND\n-- \n1.8.3.rc2.14.g7eee6b3\n"},{"id":"219946","messageId":"20130609080932.GD32139@sigill.intra.peff.net","threadId":"34072","inReplyTo":"20130609080722.GA31699@sigill.intra.peff.net","subject":"[PATCH 4/4] t/lib-httpd/apache.conf: configure an MPM module for apache 2.4","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-09T08:09:32Z","receivedAt":"2013-06-09T08:09:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Versions of Apache before 2.4 always had a \"MultiProcessing\nModule\" (MPM) statically built in, which manages the worker\nthreads/processes. We do not care which one, as it is\nlargely a performance issue, and we put only a light load on\nthe server during our testing.\n\nAs of Apache 2.4, the MPM module is loadable just like any\nother module, but exactly one such module must be loaded. On\na system where the MPMs are compiled dynamically (e.g.,\nDebian unstable), this means that our test Apache server\nwill not start unless we provide the appropriate\nconfiguration.\n\nUnfortunately, we do not actually know which MPM modules are\navailable or appropriate for the system on which the tests\nare running. This patch picks the \"prefork\" module, as it\nis likely to be available on all Unix-like systems.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/lib-httpd/apache.conf | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf\nindex 4883b8c..56ae548 100644\n--- a/t/lib-httpd/apache.conf\n+++ b/t/lib-httpd/apache.conf\n@@ -57,6 +57,9 @@ ErrorLog error.log\n <IfModule !mod_access_compat.c>\n \tLoadModule access_compat_module modules/mod_access_compat.so\n </IfModule>\n+<IfModule !mod_mpm_prefork.c>\n+\tLoadModule mpm_prefork_module modules/mod_mpm_prefork.so\n+</IfModule>\n </IfVersion>\n \n PassEnv GIT_VALGRIND\n-- \n1.8.3.rc2.14.g7eee6b3\n"},{"id":"220896","messageId":"7v61xgpph2.fsf@alter.siamese.dyndns.org","threadId":"34072","inReplyTo":"20130609080722.GA31699@sigill.intra.peff.net","subject":"Re: [RFH/PATCH 0/4] git http tests with apache 2.4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-14T17:32:57Z","receivedAt":"2013-06-14T17:32:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Apache 2.4 recently shipped in Debian unstable, and I noticed that all\n> of the git httpd tests stopped working. It turns out that some\n> configuration directives have changed between 2.2 and 2.4, and the httpd\n> server would not start at all.\n>\n> With this series, the tests run again (for me, at least). The\n> \"<IfVersion>\" checks hopefully mean that there are no regressions for\n> people running 2.2 and lower.\n>\n> However, the final patch is very unsatisfactory. We have to pick an MPM\n> module to mention in the config, but we don't have any idea what's\n> available. I suspect what I have provided will work on most Unix-ish\n> systems. Under Windows, there is a totally different MPM. But I am not\n> sure that our http tests run at all on Windows, as we seem to check in\n> lib-httpd.sh for a Unix-ish apache module path.\n\nThanks.  I think the final one, while it may be unsatisfactory, is a\nreasonable (or \"least bad\") compromise, at least for now.  I do not\nthink of a better way, without adding \"if you want customization,\nwrite a snippet to be included in the configuration used during the\ntest\", which feels way overkill.\n>\n> As far as I know, Apache does not have a \"try to load this module and\n> fallback\" directive. We could perhaps look in the module directory and\n> try to do something clever in the shell before starting Apache. Advice\n> from Apache gurus is welcome.\n>\n>   [1/4]: t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4\n>   [2/4]: t/lib-httpd/apache.conf: load extra auth modules in apache 2.4\n>   [3/4]: t/lib-httpd/apache.conf: load compat access module in apache 2.4\n>   [4/4]: t/lib-httpd/apache.conf: configure an MPM module for apache 2.4\n>\n> -Peff\n"},{"id":"220918","messageId":"20130614215801.GC29138@sigill.intra.peff.net","threadId":"34072","inReplyTo":"7v61xgpph2.fsf@alter.siamese.dyndns.org","subject":"Re: [RFH/PATCH 0/4] git http tests with apache 2.4","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-14T21:58:01Z","receivedAt":"2013-06-14T21:58:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jun 14, 2013 at 10:32:57AM -0700, Junio C Hamano wrote:\n\n> > However, the final patch is very unsatisfactory. We have to pick an MPM\n> > module to mention in the config, but we don't have any idea what's\n> > available. I suspect what I have provided will work on most Unix-ish\n> > systems. Under Windows, there is a totally different MPM. But I am not\n> > sure that our http tests run at all on Windows, as we seem to check in\n> > lib-httpd.sh for a Unix-ish apache module path.\n> \n> Thanks.  I think the final one, while it may be unsatisfactory, is a\n> reasonable (or \"least bad\") compromise, at least for now.  I do not\n> think of a better way, without adding \"if you want customization,\n> write a snippet to be included in the configuration used during the\n> test\", which feels way overkill.\n\nYeah, we may have to go there. My feeling on it (and why I posted it\nas-is) is that it improves the situation for some people, and should be\nno worse for anyone else. Therefore people who are on 2.4 and are still\nbroken after this series can speak up and show us the exact breakage and\nfix they need without us having to guess.\n\n-Peff\n"}]}