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

I have setup redmine integration with apache as described in the redmine documentation. I have a /git path accessible with auth and /git-private accessible only to redmine. When I clone the repository through /git path, I get the up-to-date repo. But when I try to view it in redmine repo viewer, I get a 404 "The entry or revision was not found in the repository." error. Trying to clone using the git-private url in the redmine box gives a bare repository though it is the same repo as the one cloned by the /git path. I have enabled RedmineGitSmartHttp in the /git path. What could be the issue here?

PerlLoadModule Apache::Redmine

SetEnv GIT_PROJECT_ROOT /path/to/git/root
SetEnv GIT_HTTP_EXPORT_ALL

ScriptAlias /git/ /usr/lib/git-core/git-http-backend/

<Location /git>
      AuthType Basic
      Require valid-user
      AuthName "Git"

      PerlAccessHandler Apache::Authn::Redmine::access_handler
      PerlAuthenHandler Apache::Authn::Redmine::authen_handler

      RedmineDSN "DBI:mysql:database=<dbname>;host=<db host>" 
      RedmineDbUser "<user>" 
      RedmineDbPass "<password" 

      RedmineGitSmartHttp yes
</Location>

<Location /git-private>
      Order deny,allow
      Deny from all

     <Limit GET PROPFIND OPTIONS REPORT>
        Options Indexes FollowSymLinks MultiViews
         Allow from <redmine public ip>
         Allow from <redmine pvt ip>
         Allow from <localhost>
     </Limit>
</Location>
share|improve this question
    
It seems to me that all the redmine options are only set on /git and not /git-private but I don't know if that's intentional... –  DerfK Jul 7 '12 at 19:19
    
@DerfK The redmine options are set on /git because that is the path through which the world will access the git repository and hence it has Redmine options pertaining to authentication and access permissions. /git-private is meant only for redmine to use and it just reads the repositories directly over http without requiring any credentials. Is there some issue with this? –  Guruprasad Jul 8 '12 at 5:19

1 Answer 1

Redmine can't access a git repository via HTTP. It always needs direct file system access to the bare git repo for showing its content on the Repository tab. Thus your /git-private construct will not work at all (although something like this could be done with Subversion)

Consequently, in the repository settings of Redmine, you have to enter a filesystem path to the bare git repository, not a URL.

share|improve this answer
    
Isn't it a bad idea to give server paths in redmine? If the server is migrated to another server and the path there changes, then this would require a lot of changes –  Guruprasad Jul 9 '12 at 5:10
    
Also I have seen a lot of howto's on the internet which use exactly the same method and I don't see how and why redmine cannot access the git repo over http –  Guruprasad Jul 9 '12 at 5:14

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.