我有一臺在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/」不起作用。