git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: readme fixed regarding per user project root repository
@ 2010-03-22 22:15 Sylvain Rabot
  2010-03-22 22:15 ` Sylvain Rabot
  0 siblings, 1 reply; 8+ messages in thread
From: Sylvain Rabot @ 2010-03-22 22:15 UTC (permalink / raw)
  To: git

This is a small modification of the patch I sent (Message-ID: <1267488297-10415-1-git-send-email-sylvain@abstraction.fr>) not yet applied, as far as I have seen.

It includes a fix for a rewrite rule wich was working but not useable, an update to make another one better and some typos fixes.

Regards.

--
Sylvain

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] gitweb multiple project roots documentation
@ 2010-03-02  0:04 Sylvain Rabot
  2010-03-10 18:55 ` [PATCH] gitweb readme fixed regarding per user project root repository Sylvain Rabot
  0 siblings, 1 reply; 8+ messages in thread
From: Sylvain Rabot @ 2010-03-02  0:04 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski, Sylvain Rabot

This commit adds in the gitweb/README file a description of how to use gitweb
with several project roots using apache virtualhost rewrite rules.

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
---
 gitweb/README |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 64 insertions(+), 3 deletions(-)

diff --git a/gitweb/README b/gitweb/README
index 6c2c8e1..2e55d38 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -312,12 +312,16 @@ If you want to have one URL for both gitweb and your http://
 repositories, you can configure apache like this:
 
 <VirtualHost *:80>
-    ServerName git.example.org
-    DocumentRoot /pub/git
-    SetEnv	GITWEB_CONFIG	/etc/gitweb.conf
+    ServerName		git.example.org
+    DocumentRoot	/pub/git
+    SetEnv			GITWEB_CONFIG	/etc/gitweb.conf
+
+    # turning on mod rewrite
     RewriteEngine on
+
     # make the front page an internal rewrite to the gitweb script
     RewriteRule ^/$  /cgi-bin/gitweb.cgi
+
     # make access for "dumb clients" work
     RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
 </VirtualHost>
@@ -343,6 +347,63 @@ something like the following in your gitweb.conf (or gitweb_config.perl) file:
   $home_link = "/";
 
 
+Webserver configuration with multiple projects' root
+----------------------------------------------------
+
+If you want to use gitweb with several project roots you can edit your apache
+virtual host and gitweb.conf configuration files like this :
+
+virtual host configuration :
+
+<VirtualHost *:80>
+    ServerName			git.example.org
+    DocumentRoot		/pub/git
+    SetEnv				GITWEB_CONFIG	/etc/gitweb.conf
+
+    # turning on mod rewrite
+    RewriteEngine on
+
+    # make the front page an internal rewrite to the gitweb script
+    RewriteRule ^/$ 		/cgi-bin/gitweb.cgi [QSA,L,PT]
+
+    # look for a public_git folder in unix users' home
+    # http://git.example.org/~<user>/
+    RewriteRule ^/\~([^\/]+)(/|/gitweb.cgi)?$	/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+
+    # http://git.example.org/+<user>/
+    #RewriteRule ^/\+([^\/]+)(/|/gitweb.cgi)?$	/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+
+    # http://git.example.org/user/<user>/
+    #RewriteRule ^/user/([^\/]+)/(gitweb.cgi)?$	/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/public_git/,L,PT]
+
+    # defined list of project roots
+    RewriteRule ^/scm(/|/gitweb.cgi)?$		/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/pub/scm/,L,PT]
+    RewriteRule ^/var(/|/gitweb.cgi)?$		/cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/var/git/,L,PT]
+
+    # make access for "dumb clients" work
+    RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
+</VirtualHost>
+
+gitweb.conf configuration :
+
+$projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/pub/git";
+
+These configurations enable two things. First, each unix user (<user>) of the
+server will be able to browse through gitweb git repositories found in
+~/public_git/ with the following url : http://git.example.org/~<user>/
+
+If you do not want this feature on your server just remove the second rewrite rule.
+
+If you already use mod_userdir in your virtual host or you don't want to use 
+the '~' as first character just comment or remove the second rewrite rule and 
+uncomment one of the following according to what you want.
+
+Second, repositories found in /pub/scm/ and /var/git/ will be accesible
+through http://git.example.org/scm/ and http://git.example.org/var/.
+You can add as many project roots as you want by adding rewrite rules like the
+third and the fourth.
+
+
 PATH_INFO usage
 -----------------------
 If you enable PATH_INFO usage in gitweb by putting
-- 
1.7.0

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

end of thread, other threads:[~2010-03-29 22:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 22:15 [PATCH] gitweb: readme fixed regarding per user project root repository Sylvain Rabot
2010-03-22 22:15 ` Sylvain Rabot
2010-03-26 18:52   ` Junio C Hamano
2010-03-29 20:43     ` Sylvain Rabot
2010-03-29 22:34     ` [PATCH 0/2] gitweb: updates regaring pêr user project root directory Sylvain Rabot
2010-03-29 22:34       ` [PATCH 1/2] gitweb: dirty patch to make url rewriting involving '+' working Sylvain Rabot
2010-03-29 22:34         ` [PATCH 2/2] gitweb: readme fixed regarding per user project root repository Sylvain Rabot
  -- strict thread matches above, loose matches on Subject: below --
2010-03-02  0:04 [PATCH] gitweb multiple project roots documentation Sylvain Rabot
2010-03-10 18:55 ` [PATCH] gitweb readme fixed regarding per user project root repository Sylvain Rabot

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 NNTP newsgroup(s).