git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3] Smart-http documentation: add example of how to execute from userdir

From
TCTarmigan Casebolt <tarmigan+git@gmail.com>
Date
Jan 2, 2010, 21:18 UTC
Message-ID
<1262467101-5755-1-git-send-email-tarmigan+git@gmail.com>
In-Reply-To
<be6fef0d0912301818o678976ebqa3e339dc1ff1f2e8@mail.gmail.com>

Smart-http may be an attactive and easy way for people to setup git hosting on shared servers whose primary web server configuration they do not control. To facilite this, provide an example of how it may be done.

cc:  Tay Ray Chuan <rctay89@gmail.com>
cc: Shawn O. Pearce <spearce@spearce.org>
Editing-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
 Documentation/git-http-backend.txt |   32 ++++++++++++++++++++++++++++++--
 1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 67aec06..0485033 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -60,8 +60,8 @@ automatically by the web server.
 
 EXAMPLES
 --------
-All of the following examples map 'http://$hostname/git/foo/bar.git'
-to '/var/www/git/foo/bar.git'.
+Unless otherwise noted, the following examples map
+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.
 
 Apache 2.x::
 	Ensure mod_cgi, mod_alias, and mod_env are enabled, set
@@ -144,6 +144,34 @@ ScriptAliasMatch \
 ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
 ----------------------------------------------------------------
 
+In the following example, the repository at
+'/home/$username/devel/foo/bar.git' will be accessible at
+'http://$hostname/~$username/cgi-bin/git/foo/bar.git'.
+
+From UserDir on Apache 2.x::
+       One way to configure 'git-http-backend' to execute and serve
+       from a user directory (for example, on a shared hosting
+       provider), is to have a symbolic link named 'git' that points
+       from the cgi directory to the 'git-http-backend' executable in
+       libexec.  The advantage is that this symbolic link always
+       points to the latest installed version; one does not have to
+       make any changes to the symbolic link when the installed
+       'git-http-backend' is updated.
++
+----------------------------------------------------------------
+SetHandler cgi-script
+Options +SymLinksIfOwnerMatch
+SetEnv GIT_PROJECT_ROOT /home/$username/devel
+----------------------------------------------------------------
++
+Also add any needed authentication to the .htaccess file as discussed
+in earlier examples.
++
+If the web server does not follow any symbolic links, the
+'git-http-backend' executable may be copied into the cgi-bin directory
+and renamed to 'git' to acheive the same effect, but it will also need
+to be manually updated whenever a new version of 'git-http-backend' is
+installed.
 
 ENVIRONMENT
 -----------
-- 
1.6.6.236.gc56f3
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 6 of 14 in “Smart-http documentation: add example of how to execute from userdir”
  1. Smart-http documentation: add example of how to execute from userdirTarmigan Casebolt, Dec 26, 2009
  2. Tay Ray ChuanDec 27, 2009
  3. TarmiganDec 28, 2009
  4. Smart-http documentation: add example of how to execute from userdirTarmigan Casebolt, Dec 28, 2009
  5. Tay Ray ChuanDec 31, 2009
  6. Smart-http documentation: add example of how to execute from userdirTarmigan Casebolt, Jan 2, 2010
  7. Tay Ray ChuanJan 3, 2010
  8. Junio C HamanoJan 3, 2010
  9. Shawn O. PearceJan 4, 2010
  10. TarmiganJan 5, 2010
  11. Smart-http documentation: add example of how to execute from userdirTarmigan Casebolt, Jan 5, 2010
  12. Junio C HamanoJan 5, 2010
  13. Shawn O. PearceDec 27, 2009
  14. TarmiganDec 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.