将gitlab存储库添加到redmine

时间:2013-12-02 02:23:19

标签: git ubuntu redmine gitlab

我正在尝试添加一个gitlab存储库来redmine,但是当通过redmine访问存储库时,会显示以下消息:

  

“在存储库中找不到条目或修订版。”

我的回购配置:

enter image description here

redmine: 2.4.1
操作系统: ubuntu

编辑:

测试www-data权限:

root@Development:~# su www-data
$  ls /home/git/repositories/mapb_1990/test.git/
branches  config  description  HEAD  hooks  info  objects  refs

1 个答案:

答案 0 :(得分:3)

如果您正在为Apache使用Passenger模块,那么它可能会在nobody用户(而不是www-data)下运行。 退房:

root@Development:~# ps auxf | grep -A 8 -e "/usr/sbin/apache2 -k star[t]" -e /usr/local/share/redmin[e]

并查找以 Passenger Rack 开头的流程:它们是否在nobody下运行(我有完全相同的问题并立即修复它以便我可以不检查你应该有什么确切的输出。

(Redmine位于我设置中的 / usr / local / share / redmine )。

并且,在默认设置中,nobody无法访问 / home / git / repositories /

root@Development:~# su nobody
sh-4.2$ ls /home/git/repositories/
ls: cannot access /home/git/repositories/: Permission denied

您有两种选择:

  • 向所有人提供“/home/git/repositories/mapb_1990/test.git/”的路径(chmod -R o=rx /home/git/repositories/mapb_1990/test.git/
  • 通过在VirtualHost文件中添加以下行来更改VirtualHost配置中的乘客使用和组:

    <IfModule mod_passenger.c>
        PassengerUser www-data
        PassengerGroup www-data
    </IfModule>
    

    您可能还想运行这些命令以确保以前nobody:nogroup拥有的文件转移到www-data:www-data

    root@Development:~# find /usr/local/share/redmine -user nobody -exec chown www-data {} \;
    root@Development:~# find /usr/local/share/redmine -group nogroup -exec chgrp www-data {} \;
    

    重启Apache:

    root@Development:~# service apache2 restart