{"thread":{"id":"22029","subject":"[PATCH] Smart-http documentation: add example of how to execute from userdir","startedAt":"2009-12-26T17:07:35Z","lastAt":"2010-01-05T08:23:25Z","messageCount":14,"participants":["Tarmigan Casebolt","Tay Ray Chuan","Shawn O. Pearce","Tarmigan","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"130349","messageId":"1261847255-13970-1-git-send-email-tarmigan+git@gmail.com","threadId":"22029","inReplyTo":null,"subject":"[PATCH] Smart-http documentation: add example of how to execute from userdir","fromName":"Tarmigan Casebolt","fromEmail":"tarmigan+git@gmail.com","sentAt":"2009-12-26T17:07:35Z","receivedAt":"2009-12-26T17:07:35Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"Smart-http may be an attactive and easy way for people to setup git\nhosting on shared servers whose primary web server configuration they\ndo not control.  To facilite this, provide an example of how it may be\ndone.\n\ncc: Shawn O. Pearce <spearce@spearce.org>\nSigned-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>\n---\n Documentation/git-http-backend.txt |   40 ++++++++++++++++++++++++++++++++++-\n 1 files changed, 38 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt\nindex 67aec06..0cca5ba 100644\n--- a/Documentation/git-http-backend.txt\n+++ b/Documentation/git-http-backend.txt\n@@ -60,8 +60,8 @@ automatically by the web server.\n \n EXAMPLES\n --------\n-All of the following examples map 'http://$hostname/git/foo/bar.git'\n-to '/var/www/git/foo/bar.git'.\n+Unless otherwise noted, the following examples map\n+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.\n \n Apache 2.x::\n \tEnsure mod_cgi, mod_alias, and mod_env are enabled, set\n@@ -144,6 +144,42 @@ ScriptAliasMatch \\\n ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/\n ----------------------------------------------------------------\n \n+In the following example, a repository at\n+'/home/$username/devel/foo/bar.git' will be accessible at\n+'http://$hostname/\\~$username/cgi-bin/git/foo/bar.git'\n+\n+From UserDir on Apache 2.x::\n+       One way to configure 'git-http-backend' to execute and serve\n+       from a user directory (for example, on a shared hosting\n+       provider), is to have a symbolic link that points from the cgi\n+       directory to the 'git-http-backend' executable in libexec.  The\n+       advantage of the symblic link is that any updates to the\n+       installed version of 'git-http-backend' also update the version\n+       that is run in the userdir.  Depending on the configuration of\n+       the server, the symbolic link may be able to point to a global\n+       installation of git.  If, for security reasons, the server is\n+       configured to follow symbolic links only if the owner matches,\n+       an installation of git into the user directory may be required.\n+       In that case, install git as that user into \\~/bin, \\~/libexec\n+       etc.  Then create a symlink named 'git' in the cgi-bin\n+       directory that points to\n+       \\~/libexec/git-core/git-http-backend. Put the following in\n+       \\~/public_html/cgi-bin/.htaccess:\n++\n+----------------------------------------------------------------\n+SetHandler cgi-script\n+Options +SymLinksIfOwnerMatch\n+SetEnv GIT_PROJECT_ROOT /home/$username/devel\n+----------------------------------------------------------------\n++\n+Also add any needed authentication to the .htaccess file as discussed\n+in earlier examples.\n++\n+If the web server does not follow any symbolic links, the\n+'git-http-backend' executable may be copied into the cgi-bin directory\n+and renamed to 'git' to acheive the same effect, but it will also need\n+to be manually updated whenever a new version of 'git-http-backend' is\n+installed.\n \n ENVIRONMENT\n -----------\n-- \n1.6.6\n"},{"id":"130356","messageId":"be6fef0d0912261919m7b175c4fh532ad05a713d86c7@mail.gmail.com","threadId":"22029","inReplyTo":"1261847255-13970-1-git-send-email-tarmigan+git@gmail.com","subject":"Re: [PATCH] Smart-http documentation: add example of how to execute from userdir","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-12-27T03:19:00Z","receivedAt":"2009-12-27T03:19:00Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sun, Dec 27, 2009 at 1:07 AM, Tarmigan Casebolt\n<tarmigan+git@gmail.com> wrote:\n> @@ -60,8 +60,8 @@ automatically by the web server.\n>\n>  EXAMPLES\n>  --------\n> -All of the following examples map 'http://$hostname/git/foo/bar.git'\n> -to '/var/www/git/foo/bar.git'.\n> +Unless otherwise noted, the following examples map\n> +'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.\n\nThis rephrase seems to be unrelated (to providing an example of\nserving smart http).\n\n> @@ -144,6 +144,42 @@ ScriptAliasMatch \\\n>  ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/\n>  ----------------------------------------------------------------\n>\n> +In the following example, a repository at\n> +'/home/$username/devel/foo/bar.git' will be accessible at\n> +'http://$hostname/\\~$username/cgi-bin/git/foo/bar.git'\n> +\n> +From UserDir on Apache 2.x::\n> +       One way to configure 'git-http-backend' to execute and serve\n> +       from a user directory (for example, on a shared hosting\n> +       provider), is to have a symbolic link that points from the cgi\n> +       directory to the 'git-http-backend' executable in libexec.  The\n> +       advantage of the symblic link is that any updates to the\n\ns/symblic/symbolic/.\n\n> +       installed version of 'git-http-backend' also update the version\n\ns/update/updates/.\n\n> +       that is run in the userdir.  Depending on the configuration of\n> +       the server, the symbolic link may be able to point to a global\n> +       installation of git.  If, for security reasons, the server is\n\nAt this point, the user dealing with the \"easy\" case (ie. the user\njust symlinks the shared git installation and doesn't have to create\nsymlinks in his own home directory) should have enough configuration\ndetails without having to read any further. So, you could tell the\nuser about the symlinks to create and the configuration lines in\n.htaccess.\n\nIt might also be a good idea to start a new paragraph for the \"hard\"\ncase, for better readability.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"130373","messageId":"20091227211557.GC609@spearce.org","threadId":"22029","inReplyTo":"1261847255-13970-1-git-send-email-tarmigan+git@gmail.com","subject":"Re: [PATCH] Smart-http documentation: add example of how to execute from userdir","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-12-27T21:15:57Z","receivedAt":"2009-12-27T21:15:57Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Tarmigan Casebolt <tarmigan+git@gmail.com> wrote:\n> Smart-http may be an attactive and easy way for people to setup git\n> hosting on shared servers whose primary web server configuration they\n> do not control.  To facilite this, provide an example of how it may be\n> done.\n...\n> +       \\~/public_html/cgi-bin/.htaccess:\n> ++\n> +----------------------------------------------------------------\n> +SetHandler cgi-script\n> +Options +SymLinksIfOwnerMatch\n> +SetEnv GIT_PROJECT_ROOT /home/$username/devel\n> +----------------------------------------------------------------\n\nAt this point, isn't this just easier?\n\n  mkdir ~/public_html/git\n  vi ~/public_html/git/.htaccess\n\n  SetEnv GIT_PROJECT_ROOT /home/$username/devel\n  ScriptAlias / /usr/libexec/git-core/git-http-backend/\n\nNo need to mess around with SymlinksIfOwnerMatch and all of that fun.\nIf you have .htaccess override allows, you should be able to setup\na ScriptAlias without needing to use a cgi-bin directory.\n\n-- \nShawn.\n"},{"id":"130380","messageId":"905315640912272006o6a8fecddiebb66cc243593fad@mail.gmail.com","threadId":"22029","inReplyTo":"20091227211557.GC609@spearce.org","subject":"Re: [PATCH] Smart-http documentation: add example of how to execute from userdir","fromName":"Tarmigan","fromEmail":"tarmigan+git@gmail.com","sentAt":"2009-12-28T04:06:59Z","receivedAt":"2009-12-28T04:06:59Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"On Sun, Dec 27, 2009 at 4:15 PM, Shawn O. Pearce <spearce@spearce.org> wrote:\n> Tarmigan Casebolt <tarmigan+git@gmail.com> wrote:\n>> Smart-http may be an attactive and easy way for people to setup git\n>> hosting on shared servers whose primary web server configuration they\n>> do not control.  To facilite this, provide an example of how it may be\n>> done.\n> ...\n>> +       \\~/public_html/cgi-bin/.htaccess:\n>> ++\n>> +----------------------------------------------------------------\n>> +SetHandler cgi-script\n>> +Options +SymLinksIfOwnerMatch\n>> +SetEnv GIT_PROJECT_ROOT /home/$username/devel\n>> +----------------------------------------------------------------\n>\n> At this point, isn't this just easier?\n>\n>  mkdir ~/public_html/git\n>  vi ~/public_html/git/.htaccess\n>\n>  SetEnv GIT_PROJECT_ROOT /home/$username/devel\n>  ScriptAlias / /usr/libexec/git-core/git-http-backend/\n\nYes, that would be perfect.  But ScriptAlias is only valid in the\n\"server config\" or \"virtual host\" contexts which is why the\nsymlink/copy executable convolutions might be needed.  Can you see a\nsimpler way around it?\n\nThanks,\nTarmigan\n"},{"id":"130382","messageId":"905315640912272018r1282394fh62d37b5c9e91a234@mail.gmail.com","threadId":"22029","inReplyTo":"be6fef0d0912261919m7b175c4fh532ad05a713d86c7@mail.gmail.com","subject":"Re: [PATCH] Smart-http documentation: add example of how to execute from userdir","fromName":"Tarmigan","fromEmail":"tarmigan+git@gmail.com","sentAt":"2009-12-28T04:18:42Z","receivedAt":"2009-12-28T04:18:42Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"On Sat, Dec 26, 2009 at 10:19 PM, Tay Ray Chuan <rctay89@gmail.com> wrote:\n>> -All of the following examples map 'http://$hostname/git/foo/bar.git'\n>> -to '/var/www/git/foo/bar.git'.\n>> +Unless otherwise noted, the following examples map\n>> +'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.\n>\n> This rephrase seems to be unrelated (to providing an example of\n> serving smart http).\n\nI think this change is related because previously all the examples\nprovided the same mapping.  With the new example with a different\nmapping, the \"_All_ of the following\" is no longer true.\n\n>> @@ -144,6 +144,42 @@ ScriptAliasMatch \\\n>>  ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/\n>>  ----------------------------------------------------------------\n>>\n>> +In the following example, a repository at\n>> +'/home/$username/devel/foo/bar.git' will be accessible at\n>> +'http://$hostname/\\~$username/cgi-bin/git/foo/bar.git'\n>> +\n>> +From UserDir on Apache 2.x::\n>> +       One way to configure 'git-http-backend' to execute and serve\n>> +       from a user directory (for example, on a shared hosting\n>> +       provider), is to have a symbolic link that points from the cgi\n>> +       directory to the 'git-http-backend' executable in libexec.  The\n>> +       advantage of the symblic link is that any updates to the\n>\n> s/symblic/symbolic\n> s/update/updates/.\n\nThanks.\n\n> At this point, the user dealing with the \"easy\" case (ie. the user\n> just symlinks the shared git installation and doesn't have to create\n> symlinks in his own home directory) should have enough configuration\n> details without having to read any further. So, you could tell the\n> user about the symlinks to create and the configuration lines in\n> .htaccess.\n>\n> It might also be a good idea to start a new paragraph for the \"hard\"\n> case, for better readability.\n\nOK, these suggestions sound good to me.  I'll send out an updated patch shortly.\n\nThanks,\nTarmigan\n"},{"id":"130385","messageId":"1261975612-67101-1-git-send-email-tarmigan+git@gmail.com","threadId":"22029","inReplyTo":"905315640912272018r1282394fh62d37b5c9e91a234@mail.gmail.com","subject":"[PATCH v2] Smart-http documentation: add example of how to execute from userdir","fromName":"Tarmigan Casebolt","fromEmail":"tarmigan+git@gmail.com","sentAt":"2009-12-28T04:46:52Z","receivedAt":"2009-12-28T04:46:52Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"Smart-http may be an attactive and easy way for people to setup git\nhosting on shared servers whose primary web server configuration they\ndo not control.  To facilite this, provide an example of how it may be\ndone.\n\ncc: Tay Ray Chuan <rctay89@gmail.com>\ncc: Shawn O. Pearce <spearce@spearce.org>\nSigned-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>\n---\nLooking at the \n\ts/update/updates/\nsuggestion again, I decided not to make that change because I think\nthe original is grammical even if a little bit awkward.  The first\n'updates' is the noun, so the verb should be 'update' without an 's'.\n\nI also tried rephrasing that sentence completely, but did not end up\nwith something better.  Suggestions welcome.\n\n Documentation/git-http-backend.txt |   31 +++++++++++++++++++++++++++++--\n 1 files changed, 29 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt\nindex 67aec06..fdff2d3 100644\n--- a/Documentation/git-http-backend.txt\n+++ b/Documentation/git-http-backend.txt\n@@ -60,8 +60,8 @@ automatically by the web server.\n \n EXAMPLES\n --------\n-All of the following examples map 'http://$hostname/git/foo/bar.git'\n-to '/var/www/git/foo/bar.git'.\n+Unless otherwise noted, the following examples map\n+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.\n \n Apache 2.x::\n \tEnsure mod_cgi, mod_alias, and mod_env are enabled, set\n@@ -144,6 +144,33 @@ ScriptAliasMatch \\\n ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/\n ----------------------------------------------------------------\n \n+In the following example, a repository at\n+'/home/$username/devel/foo/bar.git' will be accessible at\n+'http://$hostname/\\~$username/cgi-bin/git/foo/bar.git'\n+\n+From UserDir on Apache 2.x::\n+       One way to configure 'git-http-backend' to execute and serve\n+       from a user directory (for example, on a shared hosting\n+       provider), is to have a symbolic link named 'git' that points\n+       from the cgi directory to the 'git-http-backend' executable in\n+       libexec.  The advantage of the symbolic link is that any updates\n+       to the installed version of 'git-http-backend' also update the\n+       version that is run in the userdir.\n++\n+----------------------------------------------------------------\n+SetHandler cgi-script\n+Options +SymLinksIfOwnerMatch\n+SetEnv GIT_PROJECT_ROOT /home/$username/devel\n+----------------------------------------------------------------\n++\n+Also add any needed authentication to the .htaccess file as discussed\n+in earlier examples.\n++\n+If the web server does not follow any symbolic links, the\n+'git-http-backend' executable may be copied into the cgi-bin directory\n+and renamed to 'git' to acheive the same effect, but it will also need\n+to be manually updated whenever a new version of 'git-http-backend' is\n+installed.\n \n ENVIRONMENT\n -----------\n-- \n1.6.6.1.g8eede.dirty\n"},{"id":"130586","messageId":"be6fef0d0912301818o678976ebqa3e339dc1ff1f2e8@mail.gmail.com","threadId":"22029","inReplyTo":"1261975612-67101-1-git-send-email-tarmigan+git@gmail.com","subject":"Re: [PATCH v2] Smart-http documentation: add example of how to execute from userdir","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-12-31T02:18:09Z","receivedAt":"2009-12-31T02:18:09Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Mon, Dec 28, 2009 at 12:46 PM, Tarmigan Casebolt\n<tarmigan+git@gmail.com> wrote:\n> Looking at the\n>        s/update/updates/\n> suggestion again, I decided not to make that change because I think\n> the original is grammical even if a little bit awkward.  The first\n> 'updates' is the noun, so the verb should be 'update' without an 's'.\n\nIndeed.\n\n> I also tried rephrasing that sentence completely, but did not end up\n> with something better. ?Suggestions welcome.\n\nMy attempt is found below.\n\n> +In the following example, a repository at\n\nI was thinking s/a repository at/the repository/.\n\n> +'/home/$username/devel/foo/bar.git' will be accessible at\n> +'http://$hostname/\\~$username/cgi-bin/git/foo/bar.git'\n\nYou left out a full-stop for this sentence.\n\n> +From UserDir on Apache 2.x::\n> +       One way to configure 'git-http-backend' to execute and serve\n> +       from a user directory (for example, on a shared hosting\n> +       provider), is to have a symbolic link named 'git' that points\n> +       from the cgi directory to the 'git-http-backend' executable in\n> +       libexec.  The advantage of the symbolic link is that any updates\n> +       to the installed version of 'git-http-backend' also update the\n> +       version that is run in the userdir.\n\nWe could try\n\n  The advantage is that this symbolic link always points to the latest\n  installed version; one does not have to make any changes to the\n  symbolic link when the installed 'git-http-backend' is updated.\n\nI thought the corollary (after the ';') was a bit long-winded, but it\nexplains the advantage more clearly.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"130709","messageId":"1262467101-5755-1-git-send-email-tarmigan+git@gmail.com","threadId":"22029","inReplyTo":"be6fef0d0912301818o678976ebqa3e339dc1ff1f2e8@mail.gmail.com","subject":"[PATCH v3] Smart-http documentation: add example of how to execute from userdir","fromName":"Tarmigan Casebolt","fromEmail":"tarmigan+git@gmail.com","sentAt":"2010-01-02T21:18:21Z","receivedAt":"2010-01-02T21:18:21Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"Smart-http may be an attactive and easy way for people to setup git\nhosting on shared servers whose primary web server configuration they\ndo not control.  To facilite this, provide an example of how it may be\ndone.\n\ncc:  Tay Ray Chuan <rctay89@gmail.com>\ncc: Shawn O. Pearce <spearce@spearce.org>\nEditing-by: Tay Ray Chuan <rctay89@gmail.com>\nSigned-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>\n---\n Documentation/git-http-backend.txt |   32 ++++++++++++++++++++++++++++++--\n 1 files changed, 30 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt\nindex 67aec06..0485033 100644\n--- a/Documentation/git-http-backend.txt\n+++ b/Documentation/git-http-backend.txt\n@@ -60,8 +60,8 @@ automatically by the web server.\n \n EXAMPLES\n --------\n-All of the following examples map 'http://$hostname/git/foo/bar.git'\n-to '/var/www/git/foo/bar.git'.\n+Unless otherwise noted, the following examples map\n+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.\n \n Apache 2.x::\n \tEnsure mod_cgi, mod_alias, and mod_env are enabled, set\n@@ -144,6 +144,34 @@ ScriptAliasMatch \\\n ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/\n ----------------------------------------------------------------\n \n+In the following example, the repository at\n+'/home/$username/devel/foo/bar.git' will be accessible at\n+'http://$hostname/~$username/cgi-bin/git/foo/bar.git'.\n+\n+From UserDir on Apache 2.x::\n+       One way to configure 'git-http-backend' to execute and serve\n+       from a user directory (for example, on a shared hosting\n+       provider), is to have a symbolic link named 'git' that points\n+       from the cgi directory to the 'git-http-backend' executable in\n+       libexec.  The advantage is that this symbolic link always\n+       points to the latest installed version; one does not have to\n+       make any changes to the symbolic link when the installed\n+       'git-http-backend' is updated.\n++\n+----------------------------------------------------------------\n+SetHandler cgi-script\n+Options +SymLinksIfOwnerMatch\n+SetEnv GIT_PROJECT_ROOT /home/$username/devel\n+----------------------------------------------------------------\n++\n+Also add any needed authentication to the .htaccess file as discussed\n+in earlier examples.\n++\n+If the web server does not follow any symbolic links, the\n+'git-http-backend' executable may be copied into the cgi-bin directory\n+and renamed to 'git' to acheive the same effect, but it will also need\n+to be manually updated whenever a new version of 'git-http-backend' is\n+installed.\n \n ENVIRONMENT\n -----------\n-- \n1.6.6.236.gc56f3\n"},{"id":"130717","messageId":"be6fef0d1001021811x2a2a95j3ebbd19091abc60b@mail.gmail.com","threadId":"22029","inReplyTo":"1262467101-5755-1-git-send-email-tarmigan+git@gmail.com","subject":"Re: [PATCH v3] Smart-http documentation: add example of how to execute from userdir","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-01-03T02:11:46Z","receivedAt":"2010-01-03T02:11:46Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sun, Jan 3, 2010 at 5:18 AM, Tarmigan Casebolt\n<tarmigan+git@gmail.com> wrote:\n> Smart-http may be an attactive and easy way for people to setup git\n> hosting on shared servers whose primary web server configuration they\n> do not control.  To facilite this, provide an example of how it may be\n> done.\n>\n> cc:  Tay Ray Chuan <rctay89@gmail.com>\n> cc: Shawn O. Pearce <spearce@spearce.org>\n> Editing-by: Tay Ray Chuan <rctay89@gmail.com>\n> Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>\n\nAcked-by: Tay Ray Chuan <rctay89@gmail.com>\n\n-- \nCheers,\nRay Chuan\n"},{"id":"130726","messageId":"7vzl4v1t91.fsf@alter.siamese.dyndns.org","threadId":"22029","inReplyTo":"1262467101-5755-1-git-send-email-tarmigan+git@gmail.com","subject":"Re: [PATCH v3] Smart-http documentation: add example of how to execute from userdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-03T08:34:50Z","receivedAt":"2010-01-03T08:34:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tarmigan Casebolt <tarmigan+git@gmail.com> writes:\n\n> Smart-http may be an attactive and easy way for people to setup git\n> hosting on shared servers whose primary web server configuration they\n> do not control.  To facilite this, provide an example of how it may be\n> done.\n>\n> cc:  Tay Ray Chuan <rctay89@gmail.com>\n> cc: Shawn O. Pearce <spearce@spearce.org>\n> Editing-by: Tay Ray Chuan <rctay89@gmail.com>\n> Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>\n\nI still see Cc: here; are people named above (and others commented on\nearlier versions) happy with this round?\n"},{"id":"130767","messageId":"20100104140616.GB22872@spearce.org","threadId":"22029","inReplyTo":"7vzl4v1t91.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v3] Smart-http documentation: add example of how to execute from userdir","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-01-04T14:06:16Z","receivedAt":"2010-01-04T14:06:16Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Tarmigan Casebolt <tarmigan+git@gmail.com> writes:\n> \n> > Smart-http may be an attactive and easy way for people to setup git\n> > hosting on shared servers whose primary web server configuration they\n> > do not control.  To facilite this, provide an example of how it may be\n> > done.\n> >\n> > cc:  Tay Ray Chuan <rctay89@gmail.com>\n> > cc: Shawn O. Pearce <spearce@spearce.org>\n> > Editing-by: Tay Ray Chuan <rctay89@gmail.com>\n> > Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>\n> \n> I still see Cc: here; are people named above (and others commented on\n> earlier versions) happy with this round?\n\nI don't get why Options +SymLinksIfOwnerMatch is needed here.\n\nIf we are linking to the root installed git-http-backend Apache\nwill actually reject the link, because the link owner is likely to\nbe $USER while the target is owned by root.\n\nSo I really can't ACK this, the instructions don't jive with my\nunderstanding of the Apache configuration.\n\n-- \nShawn.\n"},{"id":"130826","messageId":"905315641001042359h7850c6cdrf9160030aff67839@mail.gmail.com","threadId":"22029","inReplyTo":"20100104140616.GB22872@spearce.org","subject":"Re: [PATCH v3] Smart-http documentation: add example of how to execute from userdir","fromName":"Tarmigan","fromEmail":"tarmigan+git@gmail.com","sentAt":"2010-01-05T07:59:10Z","receivedAt":"2010-01-05T07:59:10Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"On Mon, Jan 4, 2010 at 6:06 AM, Shawn O. Pearce <spearce@spearce.org> wrote:\n> Junio C Hamano <gitster@pobox.com> wrote:\n>> I still see Cc: here; are people named above (and others commented on\n>> earlier versions) happy with this round?\n>\n> I don't get why Options +SymLinksIfOwnerMatch is needed here.\n>\n> If we are linking to the root installed git-http-backend Apache\n> will actually reject the link, because the link owner is likely to\n> be $USER while the target is owned by root.\n>\n> So I really can't ACK this, the instructions don't jive with my\n> understanding of the Apache configuration.\n\nFair enough.\n\nThere seem to be three reasonable ways to run from a userdir\n(depending on what the global configuration allows):\n- symlink to global git installation (if FollowSymLinks)\n- symlink to user's git installation (if not FollowSymLink and only\nSymLinkIfOwnerMatch)\n- copy of git-http-backend binary (if no symlinks are followed)\n\nThe Options +SymLinksIfOwnerMatch is left over from when there was a\nmore detailed description of the second scenario and should probably\nbe removed now.  The user may not have a choice about which of those\nthree can be used because it depends on the global server\nconfiguration (which presumably the user does not control) so it's\ndifficult to provide instructions that will work for everyone.  The\nlast option is likely to be the most portable, but also does not get\nupdated when the primary http-backend binary is updated.\n\nEnumerating the details of setting up all of these configurations in\nthe man page seems excessive, but it would also be nice to have enough\ninformation to still make it easy.\n\nWe could do one or more of the following:\n- Remove the Options +SymLinksIfOwnerMatch as it is too specific to an\nunknown configuration and let users figure out how to get symlinks to\nwork for their particular configuration\n- Add a note to remind the user about SymLinksIfOwnerMatch or FollowSymLinks\n- Emphasize copying git-http-backend binary into the cgi-bin directory\nas that is likely the most portable across configurations\n- Expand all three scenarios in detail\n\nI'm inclined to do the first two with the following patch (cut-n-paste\nwarning) squashed in.  I'll send the complete patch as a follow up.\n\nThanks,\nTarmigan\n\ndiff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend\nindex 0485033..7af1288 100644\n--- a/Documentation/git-http-backend.txt\n+++ b/Documentation/git-http-backend.txt\n@@ -160,13 +160,14 @@ From UserDir on Apache 2.x::\n +\n ----------------------------------------------------------------\n SetHandler cgi-script\n-Options +SymLinksIfOwnerMatch\n SetEnv GIT_PROJECT_ROOT /home/$username/devel\n ----------------------------------------------------------------\n +\n Also add any needed authentication to the .htaccess file as discussed\n in earlier examples.\n +\n+Depending on the global configuration of the web server, the\n+\"FollowSymLinks\" or \"SymLinksIfOwnerMatch\" options might be needed.\n If the web server does not follow any symbolic links, the\n 'git-http-backend' executable may be copied into the cgi-bin directory\n and renamed to 'git' to acheive the same effect, but it will also need\n"},{"id":"130827","messageId":"1262678381-86653-1-git-send-email-tarmigan+git@gmail.com","threadId":"22029","inReplyTo":"905315641001042359h7850c6cdrf9160030aff67839@mail.gmail.com","subject":"[PATCH v4] Smart-http documentation: add example of how to execute from userdir","fromName":"Tarmigan Casebolt","fromEmail":"tarmigan+git@gmail.com","sentAt":"2010-01-05T07:59:41Z","receivedAt":"2010-01-05T07:59:41Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"Smart-http may be an attactive and easy way for people to setup git\nhosting on shared servers whose primary web server configuration they\ndo not control.  To facilite this, provide an example of how it may be\ndone.\n\ncc:  Tay Ray Chuan <rctay89@gmail.com>\ncc: Shawn O. Pearce <spearce@spearce.org>\nEdited-by: Tay Ray Chuan <rctay89@gmail.com>\nSigned-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>\n---\n Documentation/git-http-backend.txt |   33 +++++++++++++++++++++++++++++++--\n 1 files changed, 31 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt\nindex 67aec06..7af1288 100644\n--- a/Documentation/git-http-backend.txt\n+++ b/Documentation/git-http-backend.txt\n@@ -60,8 +60,8 @@ automatically by the web server.\n \n EXAMPLES\n --------\n-All of the following examples map 'http://$hostname/git/foo/bar.git'\n-to '/var/www/git/foo/bar.git'.\n+Unless otherwise noted, the following examples map\n+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.\n \n Apache 2.x::\n \tEnsure mod_cgi, mod_alias, and mod_env are enabled, set\n@@ -144,6 +144,35 @@ ScriptAliasMatch \\\n ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/\n ----------------------------------------------------------------\n \n+In the following example, the repository at\n+'/home/$username/devel/foo/bar.git' will be accessible at\n+'http://$hostname/~$username/cgi-bin/git/foo/bar.git'.\n+\n+From UserDir on Apache 2.x::\n+       One way to configure 'git-http-backend' to execute and serve\n+       from a user directory (for example, on a shared hosting\n+       provider), is to have a symbolic link named 'git' that points\n+       from the cgi directory to the 'git-http-backend' executable in\n+       libexec.  The advantage is that this symbolic link always\n+       points to the latest installed version; one does not have to\n+       make any changes to the symbolic link when the installed\n+       'git-http-backend' is updated.\n++\n+----------------------------------------------------------------\n+SetHandler cgi-script\n+SetEnv GIT_PROJECT_ROOT /home/$username/devel\n+----------------------------------------------------------------\n++\n+Also add any needed authentication to the .htaccess file as discussed\n+in earlier examples.\n++\n+Depending on the global configuration of the web server, the\n+\"FollowSymLinks\" or \"SymLinksIfOwnerMatch\" options might be needed.\n+If the web server does not follow any symbolic links, the\n+'git-http-backend' executable may be copied into the cgi-bin directory\n+and renamed to 'git' to acheive the same effect, but it will also need\n+to be manually updated whenever a new version of 'git-http-backend' is\n+installed.\n \n ENVIRONMENT\n -----------\n-- \n1.6.6\n"},{"id":"130830","messageId":"7veim52c5e.fsf@alter.siamese.dyndns.org","threadId":"22029","inReplyTo":"1262678381-86653-1-git-send-email-tarmigan+git@gmail.com","subject":"Re: [PATCH v4] Smart-http documentation: add example of how to execute from userdir","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-05T08:23:25Z","receivedAt":"2010-01-05T08:23:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tarmigan Casebolt <tarmigan+git@gmail.com> writes:\n\n> +Depending on the global configuration of the web server, the\n> +\"FollowSymLinks\" or \"SymLinksIfOwnerMatch\" options might be needed.\n> +If the web server does not follow any symbolic links, the\n> +'git-http-backend' executable may be copied into the cgi-bin directory\n> +and renamed to 'git' to acheive the same effect, but it will also need\n> +to be manually updated whenever a new version of 'git-http-backend' is\n> +installed.\n\nHmph, has Apache heard of hardlinks?  If not, wouldn't this be much\nsimpler?\n\n    cat >git <<\\EOF\n    #!/bin/sh\n    exec /path/to/libexec/git-core/git-http-backend \"$@\"\n    EOF\n    chmod +x git\n"}]}