0

i have gitweb configuration for apache:

#/etc/apache2/conf.d/gitweb
RewriteEngine on
RewriteRule ^/\~([a-z]*\.[a-z]*)/gitweb/([a-zA-Z0-9_\-]+\.git)/?(\?.*)?$ /cgi-bin/gitweb.cgi/$1 [L,PT]

<Directory /home/*/*/public_apache/gitweb>
  Options Indexes FollowSymlinks ExecCGI
  DirectoryIndex /cgi-bin/gitweb.cgi
  AllowOverride None
</Directory>

My problem is that i can set just one project root for gitweb. So i want to set variable for gitweb configuration. Something like:

SetEnv  GITWEB_CONFIG_PROJECT_ROOT  /home/$1/$2/public_git

So i could use it in /etc/gitweb.conf. Something like:

$projectroot = GITWEB_CONFIG_PROJECT_ROOT;

So... My question is: How can i get the path from Direcotry tag?

Mailo Světel
  • 233
  • 4
  • 10

1 Answers1

0

I'd say, do it with mod_rewrite, something like :

RewriteRule ^\~([a-z]*\.[a-z]*)/gitweb/([a-zA-Z0-9_\-]+)\.git/?(\?.*)?$ /cgi-bin/gitweb.cgi/$1 [L,PT] [L,PT,E=GITWEB_CONFIG_PROJECT_ROOT:/home/$1/$2/public_git]

That is of course, if the user and the repository part are where I think they are in your RewriteRule. It may not work as I don't know all the details, but it may give you a hint of where to go from here.

mat
  • 1,263
  • 1
  • 11
  • 15
  • For some reason the E= does not work for me. Strange is that SetEnv in directory tag works. Thank you. Ill try to discover this way – Mailo Světel Feb 23 '10 at 14:39