Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
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 Feb 23 '10 at 14:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.