【问题标题】:How do you clone a git repo over HTTP using the Bitnami Gitorious stack?如何使用 Bitnami Gitorious 堆栈通过 HTTP 克隆 git 存储库?
【发布时间】:2013-07-02 19:52:45
【问题描述】:

我有一个使用 Bitnami 脚本安装在 Ubuntu 12.04 服务器上的 gitorious 服务器。我可以使用 ssh 很好地克隆存储库,但不幸的是,当我尝试使用 https URL 时,它会克隆一个空存储库。在网上搜索后,我发现我需要安装 mod_xsendfile。我使用以下方式安装了它:

wget https://tn123.org/mod_xsendfile/mod_xsendfile-0.12.tar.gz#hash(sha256:9078ec28697d672a7f8aa3a19180109c1ccf73dc6aa335e856d1129344566b7e)
tar -xzf mod_xsendfile-0.12.tar.gz
cd mod_xsendfile-0.12/
sudo /opt/gitorious-2.4.12-1/apache2/bin/apxs -cia mod_xsendfile.c
sudo /opt/gitorious-2.4.12-1/ctlscript.sh restart

根据我能找到的所有文档,这应该就是我所需要的。我确实必须在我的 /etc/hosts 文件中为 IP 添加条目,以便 git.gitorious(我选择“gitorious”作为域名)实际上映射了正确的 IP。我在我的服务器和我想克隆到的 Ubuntu 机器上都这样做了。

不幸的是,http 克隆仍在生成空存储库,并且直接访问 URL 也不起作用。我错过了什么?

更新 编辑 /opt/gitorious-2.4.12-1/apps/gitorious/conf/gitorious.conf 并添加行

XSendFile on
XSendFilePath /opt/gitorious-2.4.12-1/apps/gitorious/tarballs

到目录标签:

<Directory "/opt/gitorious-2.4.12-1/apps/gitorious/htdocs/public">

更改了行为,现在当我转到该 URL 时,我看到的不是空白文件

好的

在此服务器上找不到请求的 URL /dejanney/dejanney.git。

我不知道这是否是进步。我已经为 XSendFilePath 尝试了不同的设置,但我似乎不能很好地工作。 “/opt/gitorious-2.4.12-1/”不起作用。

【问题讨论】:

    标签: git http ubuntu bitnami gitorious


    【解决方案1】:

    看起来我找到了解决方案,但它有点糟糕。

    我变了

    XSendFilePath /opt/gitorious-2.4.12-1/apps/gitorious/tarballs
    

    XSendFilePath /opt/gitorious-2.4.12-1/apps/gitorious/repositories
    

    导致以下错误:

    2013 年 7 月 3 日星期三 12:18:51] [错误] [客户端 143.122.172.123] (13)权限被拒绝:xsendfile:无法打开文件:/opt/gitorious-2.4.12-1/apps/gitorious/repositories /test/test.git/

    我通过运行解决了这个问题

    sudo chmod 775 /opt/gitorious-2.4.12-1/apps/gitorious/repositories
    

    我尝试过的其他方法都不起作用。我不确定这些权限是否安全,但它们让我可以通过 HTTP 进行克隆。我无法推送,但 Gitorious 无论如何都不支持 HTTP。

    【讨论】:

      猜你喜欢
      • 2012-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-04
      • 2020-12-17
      • 2018-01-22
      • 2013-11-04
      相关资源
      最近更新 更多