{"thread":{"id":"24238","subject":"[PATCH 2/3] git-instaweb: Fix Apache environment variable passing","startedAt":"2010-06-30T02:44:58Z","lastAt":"2010-07-23T18:22:09Z","messageCount":12,"participants":["Dan McGee","Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"144495","messageId":"1277865900-25044-1-git-send-email-dpmcgee@gmail.com","threadId":"24238","inReplyTo":null,"subject":"[PATCH 1/3] git-instaweb: Fix custom apache log placement","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-06-30T02:44:58Z","receivedAt":"2010-06-30T02:44:58Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"'CustomLog' is provided by mod_log_config so we need to include the module\nin our generated config. This was added in d94775e1f9a.\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\n---\n git-instaweb.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 6635fbe..a01476a 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -314,7 +314,7 @@ PidFile \"$fqgitdir/pid\"\n Listen $bind$port\n EOF\n \n-\tfor mod in mime dir; do\n+\tfor mod in mime dir log_config; do\n \t\tif test -e $module_path/mod_${mod}.so; then\n \t\t\techo \"LoadModule ${mod}_module \" \\\n \t\t\t     \"$module_path/mod_${mod}.so\" >> \"$conf\"\n-- \n1.7.1\n"},{"id":"144494","messageId":"1277865900-25044-2-git-send-email-dpmcgee@gmail.com","threadId":"24238","inReplyTo":"1277865900-25044-1-git-send-email-dpmcgee@gmail.com","subject":"[PATCH 2/3] git-instaweb: Fix Apache environment variable passing","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-06-30T02:44:59Z","receivedAt":"2010-06-30T02:44:59Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"We were passing the non-existent GIT_EXEC_DIR through instead of the real\nGIT_EXEC_PATH. In addition, these weren't being passed at all for CGI (non\nmod_perl) execution so get them included there as well.\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\n---\n git-instaweb.sh |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex a01476a..1d349b8 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -314,7 +314,7 @@ PidFile \"$fqgitdir/pid\"\n Listen $bind$port\n EOF\n \n-\tfor mod in mime dir log_config; do\n+\tfor mod in mime dir env log_config; do\n \t\tif test -e $module_path/mod_${mod}.so; then\n \t\t\techo \"LoadModule ${mod}_module \" \\\n \t\t\t     \"$module_path/mod_${mod}.so\" >> \"$conf\"\n@@ -334,7 +334,7 @@ EOF\n \t\tcat >> \"$conf\" <<EOF\n LoadModule perl_module $module_path/mod_perl.so\n PerlPassEnv GIT_DIR\n-PerlPassEnv GIT_EXEC_DIR\n+PerlPassEnv GIT_EXEC_PATH\n PerlPassEnv GITWEB_CONFIG\n <Location /gitweb.cgi>\n \tSetHandler perl-script\n@@ -364,6 +364,9 @@ EOF\n \t\t\techo \"ScriptSock logs/gitweb.sock\" >> \"$conf\"\n \t\tfi\n \t\tcat >> \"$conf\" <<EOF\n+PassEnv GIT_DIR\n+PassEnv GIT_EXEC_PATH\n+PassEnv GITWEB_CONFIG\n AddHandler cgi-script .cgi\n <Location /gitweb.cgi>\n \tOptions +ExecCGI\n-- \n1.7.1\n"},{"id":"144496","messageId":"1277865900-25044-3-git-send-email-dpmcgee@gmail.com","threadId":"24238","inReplyTo":"1277865900-25044-1-git-send-email-dpmcgee@gmail.com","subject":"[PATCH 3/3] git-instaweb: Don't assume Apache executable is named apache2","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-06-30T02:45:00Z","receivedAt":"2010-06-30T02:45:00Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"On Arch Linux, we keep the original 'httpd' name for the exectuable and\ndon't rename it or the path to the modules. Remove some of these assumptions\nand add the httpd name in where it may be required.\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\n---\n git-instaweb.sh |   10 +++++++---\n 1 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 1d349b8..d0091f2 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -43,7 +43,8 @@ test -z \"$port\" && port=1234\n \n resolve_full_httpd () {\n \tcase \"$httpd\" in\n-\t*apache2*|*lighttpd*)\n+\t*apache2*|*lighttpd*|*httpd*)\n+\t\t# yes, *httpd* covers *lighttpd* above, but it is there for clarity\n \t\t# ensure that the apache2/lighttpd command ends with \"-f\"\n \t\tif ! echo \"$httpd\" | sane_grep -- '-f *$' >/dev/null 2>&1\n \t\tthen\n@@ -300,7 +301,10 @@ EOF\n }\n \n apache2_conf () {\n-\ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n+\tif test -z \"$module_path\"; then\n+\t\ttest -d \"/usr/lib/httpd/modules\" && module_path=\"/usr/lib/httpd/modules\"\n+\t\ttest -d \"/usr/lib/apache2/modules\" && module_path=\"/usr/lib/apache2/modules\"\n+\tfi\n \tbind=\n \ttest x\"$local\" = xtrue && bind='127.0.0.1:'\n \techo 'text/css css' > \"$fqgitdir/mime.types\"\n@@ -563,7 +567,7 @@ case \"$httpd\" in\n *lighttpd*)\n \tlighttpd_conf\n \t;;\n-*apache2*)\n+*apache2*|*httpd*)\n \tapache2_conf\n \t;;\n webrick)\n-- \n1.7.1\n"},{"id":"144505","messageId":"20100630073153.GA25218@dcvr.yhbt.net","threadId":"24238","inReplyTo":"1277865900-25044-3-git-send-email-dpmcgee@gmail.com","subject":"Re: [PATCH 3/3] git-instaweb: Don't assume Apache executable is named apache2","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-06-30T07:31:53Z","receivedAt":"2010-06-30T07:31:53Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Dan McGee <dpmcgee@gmail.com> wrote:\n> On Arch Linux, we keep the original 'httpd' name for the exectuable and\n> don't rename it or the path to the modules. Remove some of these assumptions\n> and add the httpd name in where it may be required.\n> \n> Signed-off-by: Dan McGee <dpmcgee@gmail.com>\n\nThanks Dan,\n\nEverything in this series looks reasonable to me (haven't tested):\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> --- a/git-instaweb.sh\n> +++ b/git-instaweb.sh\n>  apache2_conf () {\n> -\ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n> +\tif test -z \"$module_path\"; then\n> +\t\ttest -d \"/usr/lib/httpd/modules\" && module_path=\"/usr/lib/httpd/modules\"\n> +\t\ttest -d \"/usr/lib/apache2/modules\" && module_path=\"/usr/lib/apache2/modules\"\n> +\tfi\n\nMinor style nitpicks (feel free to ignore unless somebody else feels\nmore strongly):\n\nThe preferred style in git is to have the \"then\" statement on a separate\nline, omitting the semi-colon, but there remain plenty of examples\ncontrary in our code:\n\nLikewise with \"for i in x y z; do\"\n\nWe also prefer to keep lines shorter than 80 characters (hard tabs being\n8 chars), but we also have plenty of examples contrary to that in\ninstaweb, too :x\n\n-- \nEric Wong\n"},{"id":"144512","messageId":"1277900948-16375-1-git-send-email-dpmcgee@gmail.com","threadId":"24238","inReplyTo":"20100630073153.GA25218@dcvr.yhbt.net","subject":"[PATCH 3/3] git-instaweb: Don't assume Apache executable is named apache2","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-06-30T12:29:08Z","receivedAt":"2010-06-30T12:29:08Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"On Arch Linux, we keep the original 'httpd' name for the exectuable and\ndon't rename it or the path to the modules. Remove some of these assumptions\nand add the httpd name in where it may be required. Finally, make some\nslight style adjustments to the code we are touching to make it fit the\nstyle of the rest of the script.\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\n---\n\nStyle cleanups as suggested by Eric, at least to the parts of the code I\ntouched.\n\n-Dan\n\n git-instaweb.sh |   19 ++++++++++++++-----\n 1 files changed, 14 insertions(+), 5 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 1d349b8..b7342e2 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -43,7 +43,8 @@ test -z \"$port\" && port=1234\n \n resolve_full_httpd () {\n \tcase \"$httpd\" in\n-\t*apache2*|*lighttpd*)\n+\t*apache2*|*lighttpd*|*httpd*)\n+\t\t# yes, *httpd* covers *lighttpd* above, but it is there for clarity\n \t\t# ensure that the apache2/lighttpd command ends with \"-f\"\n \t\tif ! echo \"$httpd\" | sane_grep -- '-f *$' >/dev/null 2>&1\n \t\tthen\n@@ -300,7 +301,13 @@ EOF\n }\n \n apache2_conf () {\n-\ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n+\tif test -z \"$module_path\"\n+\tthen\n+\t\ttest -d \"/usr/lib/httpd/modules\" &&\n+\t\t\tmodule_path=\"/usr/lib/httpd/modules\"\n+\t\ttest -d \"/usr/lib/apache2/modules\" &&\n+\t\t\tmodule_path=\"/usr/lib/apache2/modules\"\n+\tfi\n \tbind=\n \ttest x\"$local\" = xtrue && bind='127.0.0.1:'\n \techo 'text/css css' > \"$fqgitdir/mime.types\"\n@@ -314,8 +321,10 @@ PidFile \"$fqgitdir/pid\"\n Listen $bind$port\n EOF\n \n-\tfor mod in mime dir env log_config; do\n-\t\tif test -e $module_path/mod_${mod}.so; then\n+\tfor mod in mime dir env log_config\n+\tdo\n+\t\tif test -e $module_path/mod_${mod}.so\n+\t\tthen\n \t\t\techo \"LoadModule ${mod}_module \" \\\n \t\t\t     \"$module_path/mod_${mod}.so\" >> \"$conf\"\n \t\tfi\n@@ -563,7 +572,7 @@ case \"$httpd\" in\n *lighttpd*)\n \tlighttpd_conf\n \t;;\n-*apache2*)\n+*apache2*|*httpd*)\n \tapache2_conf\n \t;;\n webrick)\n-- \n1.7.1\n"},{"id":"144534","messageId":"7v39w48q4a.fsf@alter.siamese.dyndns.org","threadId":"24238","inReplyTo":"1277865900-25044-3-git-send-email-dpmcgee@gmail.com","subject":"Re: [PATCH 3/3] git-instaweb: Don't assume Apache executable is named apache2","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-06-30T16:03:17Z","receivedAt":"2010-06-30T16:03:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dan McGee <dpmcgee@gmail.com> writes:\n\n> On Arch Linux, we keep the original 'httpd' name for the exectuable and\n> don't rename it or the path to the modules.\n\nSorry, but I cannot parse the last 6 words here.\n\n> Remove some of these assumptions\n> and add the httpd name in where it may be required.\n> ...\n>  resolve_full_httpd () {\n>  \tcase \"$httpd\" in\n> -\t*apache2*|*lighttpd*)\n> +\t*apache2*|*lighttpd*|*httpd*)\n> +\t\t# yes, *httpd* covers *lighttpd* above, but it is there for clarity\n\nThat may make things work better on Arch but I wonder if there are\nplatforms that allow users to point at their favorite, non-Apache, http\nserver with a canonical name \"httpd\" that gets broken by this change.  Am\nI being too paranoid?\n\nOther two patches looked very sane.  Thanks.\n"},{"id":"144536","messageId":"AANLkTimfy0F7x-WZpfJ0J45jUWjb9lrJt99jY0fO6ZzC@mail.gmail.com","threadId":"24238","inReplyTo":"AANLkTikYNVLM9MrmL819__Viap7ucvmrs7faeC4tdDmn@mail.gmail.com","subject":"Re: [PATCH 3/3] git-instaweb: Don't assume Apache executable is named apache2","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-06-30T16:38:28Z","receivedAt":"2010-06-30T16:38:28Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"On Wed, Jun 30, 2010 at 11:03 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Dan McGee <dpmcgee@gmail.com> writes:\n>\n>> On Arch Linux, we keep the original 'httpd' name for the exectuable and\n>> don't rename it or the path to the modules.\n>\n> Sorry, but I cannot parse the last 6 words here.\n\nOn Arch Linux, the executable for the Apache HTTP server keeps the\n'httpd' name and is not named 'apache2'. The path to the server\nmodules also contains 'httpd' rather than 'apache2'.\n\n>> Remove some of these assumptions\n>> and add the httpd name in where it may be required.\n>> ...\n>>  resolve_full_httpd () {\n>>       case \"$httpd\" in\n>> -     *apache2*|*lighttpd*)\n>> +     *apache2*|*lighttpd*|*httpd*)\n>> +             # yes, *httpd* covers *lighttpd* above, but it is there for clarity\n>\n> That may make things work better on Arch but I wonder if there are\n> platforms that allow users to point at their favorite, non-Apache, http\n> server with a canonical name \"httpd\" that gets broken by this change.  Am\n> I being too paranoid?\nI think you are being overcautious. Even in this case, you can specify\nthe real name of the web server through git-config or command line\nparameters to make sure it picks up the right settings. In addition,\nany web server named 'httpd' wouldn't have worked before anyway so we\naren't regressing here. Finally, I've not encountered any platform\nthat does this kind of canonical naming as web servers have very\ndifferent command line flags and interfaces anyway.\n\n> Other two patches looked very sane.  Thanks.\nNo problem.\n\n-Dan\n"},{"id":"146003","messageId":"AANLkTiknXtteX77h8Uy1JuWmGLWSSRkAGkS3INMOHBoJ@mail.gmail.com","threadId":"24238","inReplyTo":"1277865900-25044-1-git-send-email-dpmcgee@gmail.com","subject":"Re: [PATCH 1/3] git-instaweb: Fix custom apache log placement","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-07-22T18:01:02Z","receivedAt":"2010-07-22T18:01:02Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"On Tue, Jun 29, 2010 at 9:44 PM, Dan McGee <dpmcgee@gmail.com> wrote:\n> 'CustomLog' is provided by mod_log_config so we need to include the module\n> in our generated config. This was added in d94775e1f9a.\n>\n> Signed-off-by: Dan McGee <dpmcgee@gmail.com>\n\nI noticed this set of patches didn't go anywhere...at least the first\ntwo were more bug fixes than improvements so I would have expected\nthem to get into 1.7.2. Did they get lost in the shuffle?\n\n1: http://marc.info/?l=git&m=127786592330110&w=2\n2: http://marc.info/?l=git&m=127786592030105&w=2\n3: http://marc.info/?l=git&m=127791591706076&w=2\n\n-Dan\n\n> ---\n>  git-instaweb.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-instaweb.sh b/git-instaweb.sh\n> index 6635fbe..a01476a 100755\n> --- a/git-instaweb.sh\n> +++ b/git-instaweb.sh\n> @@ -314,7 +314,7 @@ PidFile \"$fqgitdir/pid\"\n>  Listen $bind$port\n>  EOF\n>\n> -       for mod in mime dir; do\n> +       for mod in mime dir log_config; do\n>                if test -e $module_path/mod_${mod}.so; then\n>                        echo \"LoadModule ${mod}_module \" \\\n>                             \"$module_path/mod_${mod}.so\" >> \"$conf\"\n> --\n> 1.7.1\n>\n>\n"},{"id":"146035","messageId":"20100722234256.GA19581@dcvr.yhbt.net","threadId":"24238","inReplyTo":"AANLkTiknXtteX77h8Uy1JuWmGLWSSRkAGkS3INMOHBoJ@mail.gmail.com","subject":"Re: [PATCH 1/3] git-instaweb: Fix custom apache log placement","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-07-22T23:42:56Z","receivedAt":"2010-07-22T23:42:56Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Dan McGee <dpmcgee@gmail.com> wrote:\n> On Tue, Jun 29, 2010 at 9:44 PM, Dan McGee <dpmcgee@gmail.com> wrote:\n> > 'CustomLog' is provided by mod_log_config so we need to include the module\n> > in our generated config. This was added in d94775e1f9a.\n> >\n> > Signed-off-by: Dan McGee <dpmcgee@gmail.com>\n> \n> I noticed this set of patches didn't go anywhere...at least the first\n> two were more bug fixes than improvements so I would have expected\n> them to get into 1.7.2. Did they get lost in the shuffle?\n> \n> 1: http://marc.info/?l=git&m=127786592330110&w=2\n> 2: http://marc.info/?l=git&m=127786592030105&w=2\n> 3: http://marc.info/?l=git&m=127791591706076&w=2\n\nHi Dan, can you address Junio's concerns here?\n\n  http://marc.info/?l=git&m=127791382102449&w=2\n\nThanks.\n\n-- \nEric Wong\n"},{"id":"146069","messageId":"AANLkTimV0kGRMwxYxQu8jgWsiwTC_msU+2QWNAmYZuYe@mail.gmail.com","threadId":"24238","inReplyTo":"20100722234256.GA19581@dcvr.yhbt.net","subject":"Re: [PATCH 1/3] git-instaweb: Fix custom apache log placement","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2010-07-23T13:40:21Z","receivedAt":"2010-07-23T13:40:21Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"On Thu, Jul 22, 2010 at 6:42 PM, Eric Wong <normalperson@yhbt.net> wrote:\n> Dan McGee <dpmcgee@gmail.com> wrote:\n>> On Tue, Jun 29, 2010 at 9:44 PM, Dan McGee <dpmcgee@gmail.com> wrote:\n>> > 'CustomLog' is provided by mod_log_config so we need to include the module\n>> > in our generated config. This was added in d94775e1f9a.\n>> >\n>> > Signed-off-by: Dan McGee <dpmcgee@gmail.com>\n>>\n>> I noticed this set of patches didn't go anywhere...at least the first\n>> two were more bug fixes than improvements so I would have expected\n>> them to get into 1.7.2. Did they get lost in the shuffle?\n>>\n>> 1: http://marc.info/?l=git&m=127786592330110&w=2\n>> 2: http://marc.info/?l=git&m=127786592030105&w=2\n>> 3: http://marc.info/?l=git&m=127791591706076&w=2\n>\n> Hi Dan, can you address Junio's concerns here?\n>\n>  http://marc.info/?l=git&m=127791382102449&w=2\n\nI did already, and got no feedback...\nhttp://marc.info/?l=git&m=127791591706076&w=2\n\n-Dan\n"},{"id":"146095","messageId":"7v7hkmf69k.fsf@alter.siamese.dyndns.org","threadId":"24238","inReplyTo":"AANLkTimV0kGRMwxYxQu8jgWsiwTC_msU+2QWNAmYZuYe@mail.gmail.com","subject":"Re: [PATCH 1/3] git-instaweb: Fix custom apache log placement","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-23T17:38:15Z","receivedAt":"2010-07-23T17:38:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dan McGee <dpmcgee@gmail.com> writes:\n\n> On Thu, Jul 22, 2010 at 6:42 PM, Eric Wong <normalperson@yhbt.net> wrote:\n> ...\n>> Hi Dan, can you address Junio's concerns here?\n>>\n>> http://marc.info/?l=git&m=127791382102449&w=2\n>\n> I did already, and got no feedback...\n> http://marc.info/?l=git&m=127791591706076&w=2\n\nThanks for a (half-) pointer [*1*]; I didn't see that message til now.\n\n>> I think you are being overcautious. Even in this case, you can specify\n>> the real name of the web server through git-config or command line\n>> parameters to make sure it picks up the right settings. \n\nIf there is an HTTP server \"httpd\" that does not understand Apache style\nconfiguration file given via \"-f\" (use of which is a misconfiguration this\npatch will start allowing users to make), we would need to add a new\ncodepath to the script to generate a configuration file to support that\nserver.  I do not think we have a mechanism to disambiguate different HTTP\nserver implementations that claim to be \"httpd\", so at that point we would\nneed to add something other than the command name for disambiguation.  But\nfor now I think your patch suffices.\n\nAs you pointed out, the last \"case\" statement in instaweb explicitly have\nrejected servers we did not know about, so my worry was unfounded; nobody\ncould have been using a daemon whose name is \"httpd\", be it ArchLinux's\nApache or something incompatible.\n\nThanks.\n\n\n[Footnote]\n\n*1* Links to marc do not have an easy way other than re-typing to get to a\nusable message-id to find the message to reply to, so while I wanted to\nmake this as a reply to your message from June 30th, I couldn't, and\ninstead I am sending this as a reply to the new message, and I had to copy\nand paste the parts of the message I responded to.\n"},{"id":"146101","messageId":"20100723182209.GA19333@dcvr.yhbt.net","threadId":"24238","inReplyTo":"AANLkTimfy0F7x-WZpfJ0J45jUWjb9lrJt99jY0fO6ZzC@mail.gmail.com","subject":"Re: [PATCH 3/3] git-instaweb: Don't assume Apache executable is named apache2","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-07-23T18:22:09Z","receivedAt":"2010-07-23T18:22:09Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Dan McGee <dpmcgee@gmail.com> wrote:\n> On Wed, Jun 30, 2010 at 11:03 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> > Dan McGee <dpmcgee@gmail.com> writes:\n> >\n> >> On Arch Linux, we keep the original 'httpd' name for the exectuable and\n> >> don't rename it or the path to the modules.\n> >\n> > Sorry, but I cannot parse the last 6 words here.\n> \n> On Arch Linux, the executable for the Apache HTTP server keeps the\n> 'httpd' name and is not named 'apache2'. The path to the server\n> modules also contains 'httpd' rather than 'apache2'.\n\n(I missed this message the first time around since I wasn't Cc-ed).\n\nThanks Dan,\n\nI've pushed your series of patches up to my \"instaweb\" branch on\ngit://git.bogomips.org/git-svn and reworked the commit message of 3/3\nbelow:\n\n>From 4bdf85995b5d21fdb085a480d529c8da0314189e Mon Sep 17 00:00:00 2001\nFrom: Dan McGee <dpmcgee@gmail.com>\nDate: Wed, 30 Jun 2010 07:29:08 -0500\nSubject: [PATCH] git-instaweb: Don't assume Apache executable is named apache2\n\nOn Arch Linux, the executable for the Apache HTTP server keeps\nthe 'httpd' name and is not named 'apache2'. The path to the\nserver modules also contains 'httpd' rather than 'apache2'.\nRemove some of these assumptions and add the httpd name in where\nit may be required. Finally, make some slight style adjustments\nto the code we are touching to make it fit the style of the rest\nof the script.\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\nAcked-by: Eric Wong <normalperson@yhbt.net>\n---\n git-instaweb.sh |   19 ++++++++++++++-----\n 1 files changed, 14 insertions(+), 5 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 1d349b8..b7342e2 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -43,7 +43,8 @@ test -z \"$port\" && port=1234\n \n resolve_full_httpd () {\n \tcase \"$httpd\" in\n-\t*apache2*|*lighttpd*)\n+\t*apache2*|*lighttpd*|*httpd*)\n+\t\t# yes, *httpd* covers *lighttpd* above, but it is there for clarity\n \t\t# ensure that the apache2/lighttpd command ends with \"-f\"\n \t\tif ! echo \"$httpd\" | sane_grep -- '-f *$' >/dev/null 2>&1\n \t\tthen\n@@ -300,7 +301,13 @@ EOF\n }\n \n apache2_conf () {\n-\ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n+\tif test -z \"$module_path\"\n+\tthen\n+\t\ttest -d \"/usr/lib/httpd/modules\" &&\n+\t\t\tmodule_path=\"/usr/lib/httpd/modules\"\n+\t\ttest -d \"/usr/lib/apache2/modules\" &&\n+\t\t\tmodule_path=\"/usr/lib/apache2/modules\"\n+\tfi\n \tbind=\n \ttest x\"$local\" = xtrue && bind='127.0.0.1:'\n \techo 'text/css css' > \"$fqgitdir/mime.types\"\n@@ -314,8 +321,10 @@ PidFile \"$fqgitdir/pid\"\n Listen $bind$port\n EOF\n \n-\tfor mod in mime dir env log_config; do\n-\t\tif test -e $module_path/mod_${mod}.so; then\n+\tfor mod in mime dir env log_config\n+\tdo\n+\t\tif test -e $module_path/mod_${mod}.so\n+\t\tthen\n \t\t\techo \"LoadModule ${mod}_module \" \\\n \t\t\t     \"$module_path/mod_${mod}.so\" >> \"$conf\"\n \t\tfi\n@@ -563,7 +572,7 @@ case \"$httpd\" in\n *lighttpd*)\n \tlighttpd_conf\n \t;;\n-*apache2*)\n+*apache2*|*httpd*)\n \tapache2_conf\n \t;;\n webrick)\n-- \nEric Wong\n"}]}