2013-07-02 63 views
1

我有一臺在Ubuntu 12.04服務器上使用Bitnami腳本安裝的gitorious服務器。我可以用ssh克隆倉庫,不幸的是,當我嘗試https URL時,它克隆了一個空的倉庫。在網上搜索後,我發現我需要安裝mod_xsendfile。我安裝使用:如何使用Bitnami Gitorious堆棧通過HTTP克隆git repo?

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我看到消息

OK

The requested URL /dejanney/dejanney.git was not found on this server.

我不知道這是否進展。我已經嘗試了XSendFilePath的不同設置,但我似乎無法正常工作。 「/opt/gitorious-2.4.12-1/」不起作用。

回答

0

看起來像我找到了一個解決方案,但它有點爛。

我改變

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

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

引起以下錯誤:

Wed Jul 03 12:18:51 2013] [error] [client 143.122.172.123] (13)Permission denied: xsendfile: cannot open file: /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。