git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Fix missing "HEAD" in the RewriteRule
@ 2008-06-07  7:19 Ask Bjørn Hansen
  2008-06-07  9:16 ` Jakub Narebski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ask Bjørn Hansen @ 2008-06-07  7:19 UTC (permalink / raw)
  To: git; +Cc: Ask Bjørn Hansen

Also add a few more hints for how to setup and configure gitweb as described
---
 gitweb/README |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

The important change is to add HEAD into the regexp, everything else is
optional...

diff --git a/gitweb/README b/gitweb/README
index 8f7ea36..b96834b 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -255,12 +255,15 @@ Webserver configuration
 If you want to have one URL for both gitweb and your http://
 repositories, you can configure apache like this:
 
-<VirtualHost www:80>
-    ServerName git.domain.org
+<VirtualHost *:80>
+    ServerName git.example.org
     DocumentRoot /pub/git
-    RewriteEngine on
-    RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
     SetEnv	GITWEB_CONFIG	/etc/gitweb.conf
+    RewriteEngine on
+    # make the front page an internal rewrite to the gitweb script 
+    RewriteEngine ^/$  /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>
 
 The above configuration expects your public repositories to live under
@@ -276,6 +279,13 @@ override the defaults given at the head of the gitweb.perl (or
 gitweb.cgi).  Look at the comments in that file for information on
 which variables and what they mean.
 
+If you use the rewrite rules from the example you'll likely also need
+something like the following in your gitweb.conf (or gitweb_config.perl) file:
+
+  @stylesheets = ("/some/absolute/path/gitweb.css");
+  $my_uri = "/";
+  $home_link = "/";
+
 
 Originally written by:
   Kay Sievers <kay.sievers@vrfy.org>
-- 
1.5.3.5.561.g140d

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

* Re: [PATCH] Fix missing "HEAD" in the RewriteRule
  2008-06-07  7:19 [PATCH] Fix missing "HEAD" in the RewriteRule Ask Bjørn Hansen
@ 2008-06-07  9:16 ` Jakub Narebski
  2008-06-07 10:06 ` Mike Hommey
  2008-06-08  1:17 ` Junio C Hamano
  2 siblings, 0 replies; 4+ messages in thread
From: Jakub Narebski @ 2008-06-07  9:16 UTC (permalink / raw)
  To: Ask Bjørn Hansen; +Cc: git

Ask Bjørn Hansen <ask@develooper.com> writes:

> Also add a few more hints for how to setup and configure gitweb as described
> ---
>  gitweb/README |   18 ++++++++++++++----
>  1 files changed, 14 insertions(+), 4 deletions(-)
> 
> The important change is to add HEAD into the regexp, everything else is
> optional...
[...]
> @@ -255,12 +255,15 @@ Webserver configuration
>  If you want to have one URL for both gitweb and your http://
>  repositories, you can configure apache like this:

Thanks a lot.

The only (minor) complaint is that from the commit message itself it
is not obvous that you meant web server (Apache) configuration trick
to have one URL for both gitweb and access via HTTP protocol for git
repositories (fetch, clone,...).

-- 
Jakub Narebski
Poland
ShadeHawk on #git

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

* Re: [PATCH] Fix missing "HEAD" in the RewriteRule
  2008-06-07  7:19 [PATCH] Fix missing "HEAD" in the RewriteRule Ask Bjørn Hansen
  2008-06-07  9:16 ` Jakub Narebski
@ 2008-06-07 10:06 ` Mike Hommey
  2008-06-08  1:17 ` Junio C Hamano
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Hommey @ 2008-06-07 10:06 UTC (permalink / raw)
  To: Ask Bjørn Hansen; +Cc: git

On Sat, Jun 07, 2008 at 12:19:26AM -0700, Ask Bjørn Hansen wrote:
> Also add a few more hints for how to setup and configure gitweb as described
> ---
>  gitweb/README |   18 ++++++++++++++----
>  1 files changed, 14 insertions(+), 4 deletions(-)
> 
> The important change is to add HEAD into the regexp, everything else is
> optional...
> 
> diff --git a/gitweb/README b/gitweb/README
> index 8f7ea36..b96834b 100644
> --- a/gitweb/README
> +++ b/gitweb/README
> @@ -255,12 +255,15 @@ Webserver configuration
>  If you want to have one URL for both gitweb and your http://
>  repositories, you can configure apache like this:
>  
> -<VirtualHost www:80>
> -    ServerName git.domain.org
> +<VirtualHost *:80>
> +    ServerName git.example.org
>      DocumentRoot /pub/git
> -    RewriteEngine on
> -    RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
>      SetEnv	GITWEB_CONFIG	/etc/gitweb.conf
> +    RewriteEngine on
> +    # make the front page an internal rewrite to the gitweb script 
> +    RewriteEngine ^/$  /cgi-bin/gitweb.cgi

You meant RewriteRule, right ?

Mike

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

* Re: [PATCH] Fix missing "HEAD" in the RewriteRule
  2008-06-07  7:19 [PATCH] Fix missing "HEAD" in the RewriteRule Ask Bjørn Hansen
  2008-06-07  9:16 ` Jakub Narebski
  2008-06-07 10:06 ` Mike Hommey
@ 2008-06-08  1:17 ` Junio C Hamano
  2 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2008-06-08  1:17 UTC (permalink / raw)
  To: Ask Bjørn Hansen; +Cc: git

Ask Bjørn Hansen <ask@develooper.com> writes:

> Also add a few more hints for how to setup and configure gitweb as described

I'll squash in Mike Hommey's typofix to make the patch to read like this:

> ...
> +    RewriteEngine on
> +    # make the front page an internal rewrite to the gitweb script 
> +    RewriteRule ^/$  /cgi-bin/gitweb.cgi
> ...

I'll also retitle it to "gitweb setup instruction: rewrite HEAD and root
as well".

Please sign-off your future patches.

Thanks.

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

end of thread, other threads:[~2008-06-08  1:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-07  7:19 [PATCH] Fix missing "HEAD" in the RewriteRule Ask Bjørn Hansen
2008-06-07  9:16 ` Jakub Narebski
2008-06-07 10:06 ` Mike Hommey
2008-06-08  1:17 ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).