Question

I have a gitorious server that was installed using the Bitnami script on an Ubuntu 12.04 server. I can clone repositories just fine using ssh, unfortunately when I try the https URLs it clones an empty repository. After searching online I found that I needed mod_xsendfile installed. I installed that using:

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

According to all of the documentation I could find that should be all I need. I did have to add entries in my /etc/hosts file for the IP so that git.gitorious (I chose "gitorious" as the domain name) actually maps the the correct IP. I did this both on my server and on the Ubuntu machine that I wanted to clone to.

Unfortunately http clones are still producing empty repositories and going to the URL directly doesn't work either. What am I missing?

Update Editing /opt/gitorious-2.4.12-1/apps/gitorious/conf/gitorious.conf and adding the lines

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

To the Directory tag:

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

Changed the behavior, now instead of a blank file when I go to that URL I see the message

OK

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

I don't know if that's progress. I've tried different settings for XSendFilePath, but I cannot seem to fine one that works. "/opt/gitorious-2.4.12-1/" does not work.

Was it helpful?

Solution

Looks like I found a solution, but it's kind of sucky.

I changed

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

to

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

Which caused the following error:

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/

I solved this by running

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

Nothing else I tried worked. I'm not sure if those permissions are safe, but they let me clone over HTTP. I cannot push but Gitorious doesn't support that over HTTP anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top