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

Re: Make Gitweb behave like Apache mod_userdir

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 17, 2009, 20:15 UTC
Message-ID
<7vhbssewm7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7fce93be0911150204h259b7424md251c54186d05b7d@mail.gmail.com>
Sylvain Rabot <sylvain@abstraction.fr> writes:
Show 14 quoted lines
> +If you want gitweb to act a bit like UserDir mod in apache, knowing, http://<host>/~<user> 
> +will list all git repos of <user> located in a special directory in his home (/home/<user>/gitweb/), 
> +do the following steps :
> +
> +Add this to the VirtualHost section of your apache configuration file :
> +
> +   RewriteRule ^/~([^\/]+)/?$  /cgi-bin/gitweb.cgi [QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]
> +
> +Modify your gitweb.conf file, located at /etc/gitweb.conf in this example, with :
> +
> +   $projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/path/to/the/defaul/project/root"; 
> +
> +Thus, each user with a gitweb folder in his home will be able to browse it with gitweb.
> +/!\ The gitweb folder and user's home folder must be readable by the webserver user.

Wouldn't it be a good idea to somehow make this work well together with the --user-path feature of git-daemon?

Perhaps the recommended name given in the example shouldn't be ~/gitweb, but more like ~/public_git, as this is like ~/public_html but for git repositories. Then the end users will browse

	http://my.site/~gitster/public_git/git.git
and gitweb can be told to show
	clone URL: git://my.site/~gitster/public_git/git.git

on the page. If the site administrator runs git-daemon with --user-path set to public_git, everything will work seamlessly, no?

Previous: Sylvain RabotNext: Sylvain Rabot
Message 7 of 18 in “Make Gitweb behave like Apache mod_userdir”
  1. Sylvain RabotNov 15, 2009
  2. Junio C HamanoNov 15, 2009
  3. Jakub NarebskiNov 17, 2009
  4. Sylvain RabotNov 17, 2009
  5. Jakub NarebskiNov 17, 2009
  6. Sylvain RabotNov 17, 2009
  7. Junio C HamanoNov 17, 2009
  8. Sylvain RabotNov 17, 2009
  9. Junio C HamanoNov 17, 2009
  10. Sylvain RabotNov 17, 2009
  11. Junio C HamanoNov 17, 2009
  12. J.H.Nov 17, 2009
  13. J.H.Nov 17, 2009
  14. Junio C HamanoNov 17, 2009
  15. J.H.Nov 17, 2009
  16. Junio C HamanoNov 18, 2009
  17. J.H.Nov 18, 2009
  18. Sylvain RabotNov 18, 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.