我在Ubuntu12.04服务器上使用Bitnami脚本安装了一个可靠的服务器。我可以很好地使用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/host文件中为IP添加条目,这样git.gitorious (我选择了“git立功”作为域名)实际上映射了正确的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/git立功-2.4.12-1/”不起作用。
发布于 2013-07-03 17:17:36
看来我找到了解决办法,但这有点烂。
我改变了
XSendFilePath /opt/gitorious-2.4.12-1/apps/gitorious/tarballs至
XSendFilePath /opt/gitorious-2.4.12-1/apps/gitorious/repositories它导致以下错误:
错误(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。
https://stackoverflow.com/questions/17434622
复制相似问题