简体   繁体   English

gitsosis,redmine,passenger:“不是git存储库”错误

[英]gitsosis, redmine, passenger: 'not a git repository' error

I installed gitosis and redmine and am running it through apache/passenger on CentOS. 我安装了gitosis和redmine,并通过CentOS上的apache / passenger运行它。 The problem is I cannot access the repositories through redmine. 问题是我无法通过Redmine访问存储库。 The error being "The entry or revision was not found in the repository. 错误为“在存储库中找不到条目或修订。

My repository is stored at 我的存储库存储在

/home/zenna/repositories/myproject.git /home/zenna/repositories/myproject.git

The error (found in the apache logs) is "fatal: Not a git repository: '/home/zenna/repositories/myproject.git'" 错误(在apache日志中找到)是"fatal: Not a git repository: '/home/zenna/repositories/myproject.git'"

It clearly is a repository as it all works fine with the WeBrick server. 显然,它是一个存储库,因为它在WeBrick服务器上都可以正常工作。 I think it's probably an issue with the apache/passenger permissions 我认为这可能是apache / passenger权限的问题

So I tried chowning the myproject.git folder with apache:apache . 所以我尝试用apache:apachemyproject.git文件夹切成小块。 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. 这没有用,我想也许Apache的用户也必须可以访问目录的父目录,所以我尝试在/myproject.git上创建到/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. 您运行的脚本/服务器带有一个在gitosis存储库中具有公共证书的用户,但是apache / passenger用户则没有。 Simple solution… create a cert for your passenger user. 简单的解决方案…为您的乘客用户创建证书。 Add it to gitosis server and assign permissions in gitosis.conf. 将其添加到gitosis服务器并在gitosis.conf中分配权限。 I gave my apache user read permissions on the entire direstory and all files / folders within. 我向我的apache用户授予了整个目录及其中所有文件/文件夹的读取权限。

However, I run apache user with sudo /usr/sbin/apachectl start 但是,我使用sudo /usr/sbin/apachectl start运行apache用户

Does this mean I would have to create a public key for root and add root to my gitosis.conf? 这是否意味着我必须为root创建一个公钥并将root添加到我的gitosis.conf中? What is the actual user trying to access the repository through redmine, root? 实际用户试图通过root的redmine访问存储库是什么? apache? 阿帕奇? passenger? 乘客?

Thanks 谢谢

尝试/home/zenna/repositories/myproject.git/.git并确保Apache用户可以读取。

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. 如果myproject.git是裸仓库,并且与redmine驻留在同一服务器上,则将myproject.git的完整文件路径放入。

So instead of gituser@domain:myproject.git, use /home/gituser/repositories/myproject.git 因此,请使用/home/gituser/repositories/myproject.git而不是gituser @ domain:myproject.git

当使用乘客时,实际用户不是谁,因此必须确保该目录(包括其所有父目录)都可以被没人用户读取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM