Skip to content

Commit 55f409a

Browse files
abhgitster
authored andcommitted
gitweb setup instruction: rewrite HEAD and root as well
Also add a few more hints for how to setup and configure gitweb as described [jc: with a fix from Mike Hommey] Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c4a7ff5 commit 55f409a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

gitweb/README

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,15 @@ Webserver configuration
255255
If you want to have one URL for both gitweb and your http://
256256
repositories, you can configure apache like this:
257257

258-
<VirtualHost www:80>
259-
ServerName git.domain.org
258+
<VirtualHost *:80>
259+
ServerName git.example.org
260260
DocumentRoot /pub/git
261-
RewriteEngine on
262-
RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
263261
SetEnv GITWEB_CONFIG /etc/gitweb.conf
262+
RewriteEngine on
263+
# make the front page an internal rewrite to the gitweb script
264+
RewriteRule ^/$ /cgi-bin/gitweb.cgi
265+
# make access for "dumb clients" work
266+
RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT]
264267
</VirtualHost>
265268

266269
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
276279
gitweb.cgi). Look at the comments in that file for information on
277280
which variables and what they mean.
278281

282+
If you use the rewrite rules from the example you'll likely also need
283+
something like the following in your gitweb.conf (or gitweb_config.perl) file:
284+
285+
@stylesheets = ("/some/absolute/path/gitweb.css");
286+
$my_uri = "/";
287+
$home_link = "/";
288+
279289

280290
Originally written by:
281291
Kay Sievers <kay.sievers@vrfy.org>

0 commit comments

Comments
 (0)