Merge branch 'master' into 6384-libpam-arvados
[arvados.git] / doc / install / install-arv-git-httpd.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install Git server
5 ...
6
7 The arv-git-httpd server provides HTTP access to hosted git repositories, using Arvados authentication tokens instead of passwords. It is intended to be installed on the system where your git repositories are stored, and accessed through a web proxy that provides SSL support.
8
9 By convention, we use the following hostname for the git service:
10
11 <div class="offset1">
12 table(table table-bordered table-condensed).
13 |git.@uuid_prefix@.your.domain|
14 </div>
15
16 This hostname should resolve from anywhere on the internet.
17
18 h2. Install arv-git-httpd
19
20 On Debian-based systems:
21
22 <notextile>
23 <pre><code>~$ <span class="userinput">sudo apt-get install git arv-git-httpd</span>
24 </code></pre>
25 </notextile>
26
27 On Red Hat-based systems:
28
29 <notextile>
30 <pre><code>~$ <span class="userinput">sudo yum install git arv-git-httpd</span>
31 </code></pre>
32 </notextile>
33
34 Verify that @arv-git-httpd@ and @git-http-backend@ are functional:
35
36 <notextile>
37 <pre><code>~$ <span class="userinput">arv-git-httpd -h</span>
38 Usage of arv-git-httpd:
39   -address="0.0.0.0:80": Address to listen on, "host:port".
40   -git-command="/usr/bin/git": Path to git executable. Each authenticated request will execute this program with a single argument, "http-backend".
41   -repo-root="/path/to/cwd": Path to git repositories.
42 ~$ <span class="userinput">git http-backend</span>
43 Status: 500 Internal Server Error
44 Expires: Fri, 01 Jan 1980 00:00:00 GMT
45 Pragma: no-cache
46 Cache-Control: no-cache, max-age=0, must-revalidate
47
48 fatal: No REQUEST_METHOD from server
49 </code></pre>
50 </notextile>
51
52 We recommend running @arv-git-httpd@ under "runit":http://smarden.org/runit/ or something similar.
53
54 Your @run@ script should look something like this:
55
56 <notextile>
57 <pre><code>export ARVADOS_API_HOST=<span class="userinput">uuid_prefix</span>.your.domain
58 exec sudo -u git arv-git-httpd -address=:9001 -git-command="$(which git)" -repo-root=<span class="userinput">/var/lib/arvados/git</span> 2>&1
59 </code></pre>
60 </notextile>
61
62 h3. Set up a reverse proxy with SSL support
63
64 The arv-git-httpd service will be accessible from anywhere on the internet, so we recommend using SSL for transport encryption.
65
66 This is best achieved by putting a reverse proxy with SSL support in front of arv-git-httpd, running on port 443 and passing requests to arv-git-httpd on port 9001 (or whatever port you chose in your run script).
67
68 h3. Tell the API server about the arv-git-httpd service
69
70 In your API server's @config/application.yml@ file, add the following entry:
71
72 <notextile>
73 <pre><code>git_http_base: git.<span class="userinput">uuid_prefix</span>.your.domain
74 </code></pre>
75 </notextile>