views:

258

answers:

4

I installed gitosis and redmine and am running it through apache/passenger on CentOS. The problem is I cannot access the repositories through redmine. The error being "The entry or revision was not found in the repository.

My repository is stored at

/home/zenna/repositories/myproject.git

The error (found in the apache logs) is "fatal: Not a git repository: '/home/zenna/repositories/myproject.git'"

It clearly is a repository as it all works fine with the WeBrick server. I think it's probably an issue with the apache/passenger permissions

So I tried chowning the myproject.git folder with apache:apache. That didn't work I thought perhaps the directory's parents must also be accessible by the apache user, so I tried creating a symbolic link at /myproject.git to /home/zenna/repositories/myproject.git. That didn't work either

Someone in the forums suggested:

You run script/server w/a user that has a public cert in the gitosis repos, but the apache/passenger user doesn’t. Simple solution… create a cert for your passenger user. Add it to gitosis server and assign permissions in gitosis.conf. I gave my apache user read permissions on the entire direstory and all files / folders within.

However, I run apache user with sudo /usr/sbin/apachectl start

Does this mean I would have to create a public key for root and add root to my gitosis.conf? What is the actual user trying to access the repository through redmine, root? apache? passenger?

Thanks

A: 

Try /home/zenna/repositories/myproject.git/.git Also make sure it's readable by the Apache user.

MarkD
A: 

If myproject.git is a bare repo and resides on the same server as redmine, then put in the full file path to myproject.git.

So instead of gituser@domain:myproject.git, use /home/gituser/repositories/myproject.git

Shoan
A: 

When using passenger the actual user is nobody so one has to make sure that the directory (which includes all of its parent directories) are readable by the nobody user.

zenna
A: 

This worked for me, thanks! I added "nobody" to my "git" group and the repository permissions are 750, so Redmine/Apache/Passenger could read the bare git repository (maintained by gitosis).

Doug