blob: 59b9ffbd97e8a956ef0012de942b69a7acd870f4 [file] [log] [blame]
Junio C Hamanof2b74942012-11-20 21:06:261<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9d971152012-12-19 00:43:115<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano61525f92014-01-17 22:46:496<meta name="generator" content="AsciiDoc 8.6.6" />
Junio C Hamano076ffcc2013-02-06 05:13:217<title>How to setup Git server over http</title>
Junio C Hamanof2b74942012-11-20 21:06:268<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:119/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamanof2b74942012-11-20 21:06:2624}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
30a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
37
38em {
39 font-style: italic;
40 color: navy;
41}
42
43strong {
44 font-weight: bold;
45 color: #083194;
46}
47
Junio C Hamanof2b74942012-11-20 21:06:2648h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:2650 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
55h1, h2, h3 {
56 border-bottom: 2px solid silver;
57}
58h2 {
59 padding-top: 0.5em;
60}
61h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9d971152012-12-19 00:43:1167h5 {
68 font-size: 1.0em;
69}
Junio C Hamanof2b74942012-11-20 21:06:2670
71div.sectionbody {
Junio C Hamanof2b74942012-11-20 21:06:2672 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
84ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9d971152012-12-19 00:43:1187ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamanof2b74942012-11-20 21:06:2689
Junio C Hamano61525f92014-01-17 22:46:4990pre {
Junio C Hamanof2b74942012-11-20 21:06:2691 padding: 0;
92 margin: 0;
93}
94
Junio C Hamano9d971152012-12-19 00:43:1195#author {
Junio C Hamanof2b74942012-11-20 21:06:2696 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:2697 font-weight: bold;
98 font-size: 1.1em;
99}
Junio C Hamano9d971152012-12-19 00:43:11100#email {
Junio C Hamanof2b74942012-11-20 21:06:26101}
Junio C Hamano9d971152012-12-19 00:43:11102#revnumber, #revdate, #revremark {
Junio C Hamanof2b74942012-11-20 21:06:26103}
104
Junio C Hamano9d971152012-12-19 00:43:11105#footer {
Junio C Hamanof2b74942012-11-20 21:06:26106 font-size: small;
107 border-top: 2px solid silver;
108 padding-top: 0.5em;
109 margin-top: 4.0em;
110}
Junio C Hamano9d971152012-12-19 00:43:11111#footer-text {
Junio C Hamanof2b74942012-11-20 21:06:26112 float: left;
113 padding-bottom: 0.5em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-badges {
Junio C Hamanof2b74942012-11-20 21:06:26116 float: right;
117 padding-bottom: 0.5em;
118}
119
Junio C Hamano9d971152012-12-19 00:43:11120#preamble {
Junio C Hamanof2b74942012-11-20 21:06:26121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
123}
Junio C Hamano9d971152012-12-19 00:43:11124div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamanof2b74942012-11-20 21:06:26125div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
126div.admonitionblock {
127 margin-top: 1.0em;
128 margin-bottom: 1.5em;
129}
130div.admonitionblock {
131 margin-top: 2.0em;
132 margin-bottom: 2.0em;
133 margin-right: 10%;
134 color: #606060;
135}
136
137div.content { /* Block element content. */
138 padding: 0;
139}
140
141/* Block element titles. */
142div.title, caption.title {
143 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26144 font-weight: bold;
145 text-align: left;
146 margin-top: 1.0em;
147 margin-bottom: 0.5em;
148}
149div.title + * {
150 margin-top: 0;
151}
152
153td div.title:first-child {
154 margin-top: 0.0em;
155}
156div.content div.title:first-child {
157 margin-top: 0.0em;
158}
159div.content + div.title {
160 margin-top: 0.0em;
161}
162
163div.sidebarblock > div.content {
164 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11165 border: 1px solid #dddddd;
166 border-left: 4px solid #f0f0f0;
Junio C Hamanof2b74942012-11-20 21:06:26167 padding: 0.5em;
168}
169
170div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11171 border: 1px solid #dddddd;
172 border-left: 5px solid #f0f0f0;
173 background: #f8f8f8;
Junio C Hamanof2b74942012-11-20 21:06:26174 padding: 0.5em;
175}
176
177div.quoteblock, div.verseblock {
178 padding-left: 1.0em;
179 margin-left: 1.0em;
180 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11181 border-left: 5px solid #f0f0f0;
182 color: #888;
Junio C Hamanof2b74942012-11-20 21:06:26183}
184
185div.quoteblock > div.attribution {
186 padding-top: 0.5em;
187 text-align: right;
188}
189
Junio C Hamano9d971152012-12-19 00:43:11190div.verseblock > pre.content {
191 font-family: inherit;
192 font-size: inherit;
Junio C Hamanof2b74942012-11-20 21:06:26193}
194div.verseblock > div.attribution {
195 padding-top: 0.75em;
196 text-align: left;
197}
198/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
199div.verseblock + div.attribution {
200 text-align: left;
201}
202
203div.admonitionblock .icon {
204 vertical-align: top;
205 font-size: 1.1em;
206 font-weight: bold;
207 text-decoration: underline;
208 color: #527bbd;
209 padding-right: 0.5em;
210}
211div.admonitionblock td.content {
212 padding-left: 0.5em;
213 border-left: 3px solid #dddddd;
214}
215
216div.exampleblock > div.content {
217 border-left: 3px solid #dddddd;
218 padding-left: 0.5em;
219}
220
221div.imageblock div.content { padding-left: 0; }
222span.image img { border-style: none; }
223a.image:visited { color: white; }
224
225dl {
226 margin-top: 0.8em;
227 margin-bottom: 0.8em;
228}
229dt {
230 margin-top: 0.5em;
231 margin-bottom: 0;
232 font-style: normal;
233 color: navy;
234}
235dd > *:first-child {
236 margin-top: 0.1em;
237}
238
239ul, ol {
240 list-style-position: outside;
241}
242ol.arabic {
243 list-style-type: decimal;
244}
245ol.loweralpha {
246 list-style-type: lower-alpha;
247}
248ol.upperalpha {
249 list-style-type: upper-alpha;
250}
251ol.lowerroman {
252 list-style-type: lower-roman;
253}
254ol.upperroman {
255 list-style-type: upper-roman;
256}
257
258div.compact ul, div.compact ol,
259div.compact p, div.compact p,
260div.compact div, div.compact div {
261 margin-top: 0.1em;
262 margin-bottom: 0.1em;
263}
264
Junio C Hamanof2b74942012-11-20 21:06:26265tfoot {
266 font-weight: bold;
267}
268td > div.verse {
269 white-space: pre;
270}
Junio C Hamanof2b74942012-11-20 21:06:26271
272div.hdlist {
273 margin-top: 0.8em;
274 margin-bottom: 0.8em;
275}
276div.hdlist tr {
277 padding-bottom: 15px;
278}
279dt.hdlist1.strong, td.hdlist1.strong {
280 font-weight: bold;
281}
282td.hdlist1 {
283 vertical-align: top;
284 font-style: normal;
285 padding-right: 0.8em;
286 color: navy;
287}
288td.hdlist2 {
289 vertical-align: top;
290}
291div.hdlist.compact tr {
292 margin: 0;
293 padding-bottom: 0;
294}
295
296.comment {
297 background: yellow;
298}
299
300.footnote, .footnoteref {
301 font-size: 0.8em;
302}
303
304span.footnote, span.footnoteref {
305 vertical-align: super;
306}
307
308#footnotes {
309 margin: 20px 0 20px 0;
310 padding: 7px 0 0 0;
311}
312
313#footnotes div.footnote {
314 margin: 0 0 5px 0;
315}
316
317#footnotes hr {
318 border: none;
319 border-top: 1px solid silver;
320 height: 1px;
321 text-align: left;
322 margin-left: 0;
323 width: 20%;
324 min-width: 100px;
325}
326
Junio C Hamano9d971152012-12-19 00:43:11327div.colist td {
328 padding-right: 0.5em;
329 padding-bottom: 0.3em;
330 vertical-align: top;
331}
332div.colist td img {
333 margin-top: 0.3em;
Junio C Hamanof2b74942012-11-20 21:06:26334}
335
Junio C Hamano9d971152012-12-19 00:43:11336@media print {
337 #footer-badges { display: none; }
338}
339
340#toc {
Junio C Hamanof2b74942012-11-20 21:06:26341 margin-bottom: 2.5em;
342}
343
Junio C Hamano9d971152012-12-19 00:43:11344#toctitle {
Junio C Hamanof2b74942012-11-20 21:06:26345 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26346 font-size: 1.1em;
347 font-weight: bold;
348 margin-top: 1.0em;
349 margin-bottom: 0.1em;
350}
351
Junio C Hamano61525f92014-01-17 22:46:49352div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanof2b74942012-11-20 21:06:26353 margin-top: 0;
354 margin-bottom: 0;
355}
356div.toclevel2 {
357 margin-left: 2em;
358 font-size: 0.9em;
359}
360div.toclevel3 {
361 margin-left: 4em;
362 font-size: 0.9em;
363}
364div.toclevel4 {
365 margin-left: 6em;
366 font-size: 0.9em;
367}
Junio C Hamanof2b74942012-11-20 21:06:26368
Junio C Hamano9d971152012-12-19 00:43:11369span.aqua { color: aqua; }
370span.black { color: black; }
371span.blue { color: blue; }
372span.fuchsia { color: fuchsia; }
373span.gray { color: gray; }
374span.green { color: green; }
375span.lime { color: lime; }
376span.maroon { color: maroon; }
377span.navy { color: navy; }
378span.olive { color: olive; }
379span.purple { color: purple; }
380span.red { color: red; }
381span.silver { color: silver; }
382span.teal { color: teal; }
383span.white { color: white; }
384span.yellow { color: yellow; }
385
386span.aqua-background { background: aqua; }
387span.black-background { background: black; }
388span.blue-background { background: blue; }
389span.fuchsia-background { background: fuchsia; }
390span.gray-background { background: gray; }
391span.green-background { background: green; }
392span.lime-background { background: lime; }
393span.maroon-background { background: maroon; }
394span.navy-background { background: navy; }
395span.olive-background { background: olive; }
396span.purple-background { background: purple; }
397span.red-background { background: red; }
398span.silver-background { background: silver; }
399span.teal-background { background: teal; }
400span.white-background { background: white; }
401span.yellow-background { background: yellow; }
402
403span.big { font-size: 2em; }
404span.small { font-size: 0.6em; }
405
406span.underline { text-decoration: underline; }
407span.overline { text-decoration: overline; }
408span.line-through { text-decoration: line-through; }
409
Junio C Hamano9d971152012-12-19 00:43:11410
411/*
412 * xhtml11 specific
413 *
414 * */
415
Junio C Hamano61525f92014-01-17 22:46:49416tt {
417 font-family: monospace;
418 font-size: inherit;
419 color: navy;
420}
421
Junio C Hamano9d971152012-12-19 00:43:11422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
Junio C Hamanof2b74942012-11-20 21:06:26425}
Junio C Hamano9d971152012-12-19 00:43:11426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
Junio C Hamanof2b74942012-11-20 21:06:26430 font-weight: bold;
Junio C Hamano9d971152012-12-19 00:43:11431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
Junio C Hamanof2b74942012-11-20 21:06:26447}
448
Junio C Hamano9d971152012-12-19 00:43:11449
450/*
451 * html5 specific
452 *
453 * */
454
Junio C Hamano61525f92014-01-17 22:46:49455.monospaced {
456 font-family: monospace;
457 font-size: inherit;
458 color: navy;
459}
460
Junio C Hamano9d971152012-12-19 00:43:11461table.tableblock {
462 margin-top: 1.0em;
463 margin-bottom: 1.5em;
464}
465thead, p.tableblock.header {
466 font-weight: bold;
467 color: #527bbd;
468}
469p.tableblock {
470 margin-top: 0;
471}
472table.tableblock {
473 border-width: 3px;
474 border-spacing: 0px;
475 border-style: solid;
476 border-color: #527bbd;
477 border-collapse: collapse;
478}
479th.tableblock, td.tableblock {
480 border-width: 1px;
481 padding: 4px;
482 border-style: solid;
483 border-color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26484}
485
Junio C Hamano9d971152012-12-19 00:43:11486table.tableblock.frame-topbot {
487 border-left-style: hidden;
488 border-right-style: hidden;
489}
490table.tableblock.frame-sides {
491 border-top-style: hidden;
492 border-bottom-style: hidden;
493}
494table.tableblock.frame-none {
495 border-style: hidden;
496}
497
498th.tableblock.halign-left, td.tableblock.halign-left {
499 text-align: left;
500}
501th.tableblock.halign-center, td.tableblock.halign-center {
502 text-align: center;
503}
504th.tableblock.halign-right, td.tableblock.halign-right {
Junio C Hamanof2b74942012-11-20 21:06:26505 text-align: right;
506}
507
Junio C Hamano9d971152012-12-19 00:43:11508th.tableblock.valign-top, td.tableblock.valign-top {
509 vertical-align: top;
Junio C Hamanof2b74942012-11-20 21:06:26510}
Junio C Hamano9d971152012-12-19 00:43:11511th.tableblock.valign-middle, td.tableblock.valign-middle {
512 vertical-align: middle;
513}
514th.tableblock.valign-bottom, td.tableblock.valign-bottom {
515 vertical-align: bottom;
Junio C Hamanof2b74942012-11-20 21:06:26516}
517
Junio C Hamano9d971152012-12-19 00:43:11518
519/*
520 * manpage specific
521 *
522 * */
523
524body.manpage h1 {
525 padding-top: 0.5em;
526 padding-bottom: 0.5em;
527 border-top: 2px solid silver;
528 border-bottom: 2px solid silver;
529}
530body.manpage h2 {
531 border-style: none;
532}
533body.manpage div.sectionbody {
534 margin-left: 3em;
Junio C Hamanof2b74942012-11-20 21:06:26535}
536
Junio C Hamano9d971152012-12-19 00:43:11537@media print {
538 body.manpage div#toc { display: none; }
539}
Junio C Hamanof2b74942012-11-20 21:06:26540</style>
541<script type="text/javascript">
542/*<![CDATA[*/
Junio C Hamanof2b74942012-11-20 21:06:26543var asciidoc = { // Namespace.
544
545/////////////////////////////////////////////////////////////////////
546// Table Of Contents generator
547/////////////////////////////////////////////////////////////////////
548
549/* Author: Mihai Bazon, September 2002
550 * http://students.infoiasi.ro/~mishoo
551 *
552 * Table Of Content generator
553 * Version: 0.4
554 *
555 * Feel free to use this script under the terms of the GNU General Public
556 * License, as long as you do not remove or alter this notice.
557 */
558
559 /* modified by Troy D. Hanson, September 2006. License: GPL */
560 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561
562// toclevels = 1..4.
563toc: function (toclevels) {
564
565 function getText(el) {
566 var text = "";
567 for (var i = el.firstChild; i != null; i = i.nextSibling) {
568 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 text += i.data;
570 else if (i.firstChild != null)
571 text += getText(i);
572 }
573 return text;
574 }
575
576 function TocEntry(el, text, toclevel) {
577 this.element = el;
578 this.text = text;
579 this.toclevel = toclevel;
580 }
581
582 function tocEntries(el, toclevels) {
583 var result = new Array;
Junio C Hamano61525f92014-01-17 22:46:49584 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
Junio C Hamanof2b74942012-11-20 21:06:26585 // Function that scans the DOM tree for header elements (the DOM2
586 // nodeIterator API would be a better technique but not supported by all
587 // browsers).
588 var iterate = function (el) {
589 for (var i = el.firstChild; i != null; i = i.nextSibling) {
590 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
591 var mo = re.exec(i.tagName);
592 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
593 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 }
595 iterate(i);
596 }
597 }
598 }
599 iterate(el);
600 return result;
601 }
602
603 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11604 if (!toc) {
605 return;
606 }
607
608 // Delete existing TOC entries in case we're reloading the TOC.
609 var tocEntriesToRemove = [];
610 var i;
611 for (i = 0; i < toc.childNodes.length; i++) {
612 var entry = toc.childNodes[i];
Junio C Hamano61525f92014-01-17 22:46:49613 if (entry.nodeName == 'div'
Junio C Hamano9d971152012-12-19 00:43:11614 && entry.getAttribute("class")
615 && entry.getAttribute("class").match(/^toclevel/))
616 tocEntriesToRemove.push(entry);
617 }
618 for (i = 0; i < tocEntriesToRemove.length; i++) {
619 toc.removeChild(tocEntriesToRemove[i]);
620 }
621
622 // Rebuild TOC entries.
Junio C Hamanof2b74942012-11-20 21:06:26623 var entries = tocEntries(document.getElementById("content"), toclevels);
624 for (var i = 0; i < entries.length; ++i) {
625 var entry = entries[i];
626 if (entry.element.id == "")
627 entry.element.id = "_toc_" + i;
628 var a = document.createElement("a");
629 a.href = "#" + entry.element.id;
630 a.appendChild(document.createTextNode(entry.text));
631 var div = document.createElement("div");
632 div.appendChild(a);
633 div.className = "toclevel" + entry.toclevel;
634 toc.appendChild(div);
635 }
636 if (entries.length == 0)
637 toc.parentNode.removeChild(toc);
638},
639
640
641/////////////////////////////////////////////////////////////////////
642// Footnotes generator
643/////////////////////////////////////////////////////////////////////
644
645/* Based on footnote generation code from:
646 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
647 */
648
649footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11650 // Delete existing footnote entries in case we're reloading the footnodes.
651 var i;
Junio C Hamanof2b74942012-11-20 21:06:26652 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11653 if (!noteholder) {
654 return;
655 }
656 var entriesToRemove = [];
657 for (i = 0; i < noteholder.childNodes.length; i++) {
658 var entry = noteholder.childNodes[i];
Junio C Hamano61525f92014-01-17 22:46:49659 if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11660 entriesToRemove.push(entry);
661 }
662 for (i = 0; i < entriesToRemove.length; i++) {
663 noteholder.removeChild(entriesToRemove[i]);
664 }
665
666 // Rebuild footnote entries.
667 var cont = document.getElementById("content");
Junio C Hamanof2b74942012-11-20 21:06:26668 var spans = cont.getElementsByTagName("span");
669 var refs = {};
670 var n = 0;
671 for (i=0; i<spans.length; i++) {
672 if (spans[i].className == "footnote") {
673 n++;
Junio C Hamano9d971152012-12-19 00:43:11674 var note = spans[i].getAttribute("data-note");
675 if (!note) {
676 // Use [\s\S] in place of . so multi-line matches work.
677 // Because JavaScript has no s (dotall) regex flag.
678 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
679 spans[i].innerHTML =
680 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
681 "' title='View footnote' class='footnote'>" + n + "</a>]";
682 spans[i].setAttribute("data-note", note);
683 }
Junio C Hamanof2b74942012-11-20 21:06:26684 noteholder.innerHTML +=
685 "<div class='footnote' id='_footnote_" + n + "'>" +
686 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
687 n + "</a>. " + note + "</div>";
Junio C Hamanof2b74942012-11-20 21:06:26688 var id =spans[i].getAttribute("id");
689 if (id != null) refs["#"+id] = n;
690 }
691 }
692 if (n == 0)
693 noteholder.parentNode.removeChild(noteholder);
694 else {
695 // Process footnoterefs.
696 for (i=0; i<spans.length; i++) {
697 if (spans[i].className == "footnoteref") {
698 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
699 href = href.match(/#.*/)[0]; // Because IE return full URL.
700 n = refs[href];
701 spans[i].innerHTML =
702 "[<a href='#_footnote_" + n +
703 "' title='View footnote' class='footnote'>" + n + "</a>]";
704 }
705 }
706 }
Junio C Hamano9d971152012-12-19 00:43:11707},
708
709install: function(toclevels) {
710 var timerId;
711
712 function reinstall() {
713 asciidoc.footnotes();
714 if (toclevels) {
715 asciidoc.toc(toclevels);
716 }
717 }
718
719 function reinstallAndRemoveTimer() {
720 clearInterval(timerId);
721 reinstall();
722 }
723
724 timerId = setInterval(reinstall, 500);
725 if (document.addEventListener)
726 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
727 else
728 window.onload = reinstallAndRemoveTimer;
Junio C Hamanof2b74942012-11-20 21:06:26729}
730
731}
Junio C Hamano9d971152012-12-19 00:43:11732asciidoc.install();
Junio C Hamanof2b74942012-11-20 21:06:26733/*]]>*/
734</script>
735</head>
Junio C Hamano9d971152012-12-19 00:43:11736<body class="article">
Junio C Hamanof2b74942012-11-20 21:06:26737<div id="header">
Junio C Hamano076ffcc2013-02-06 05:13:21738<h1>How to setup Git server over http</h1>
Junio C Hamanof2b74942012-11-20 21:06:26739</div>
740<div id="content">
741<div id="preamble">
742<div class="sectionbody">
Junio C Hamanobf398b72013-11-05 00:40:48743<div class="admonitionblock">
744<table><tr>
745<td class="icon">
746<div class="title">Note</div>
747</td>
748<td class="content">This document is from 2006. A lot has happened since then, and this
749document is now relevant mainly if your web host is not CGI capable.
750Almost everyone else should instead look at linkgit:git-http-backend[1].</td>
751</tr></table>
752</div>
Junio C Hamanof2b74942012-11-20 21:06:26753<div class="paragraph"><p>Since Apache is one of those packages people like to compile
754themselves while others prefer the bureaucrat&#8217;s dream Debian, it is
755impossible to give guidelines which will work for everyone. Just send
756some feedback to the mailing list at <a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a> to get this
757document tailored to your favorite distro.</p></div>
758<div class="paragraph"><p>What&#8217;s needed:</p></div>
759<div class="ulist"><ul>
760<li>
761<p>
762Have an Apache web-server
763</p>
764<div class="literalblock">
765<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49766<pre><tt>On Debian:
Junio C Hamanof2b74942012-11-20 21:06:26767 $ apt-get install apache2
768 To get apache2 by default started,
Junio C Hamano61525f92014-01-17 22:46:49769 edit /etc/default/apache2 and set NO_START=0</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26770</div></div>
771</li>
772<li>
773<p>
774can edit the configuration of it.
775</p>
776<div class="literalblock">
777<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49778<pre><tt>This could be found under /etc/httpd, or refer to your Apache documentation.</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26779</div></div>
780<div class="literalblock">
781<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49782<pre><tt>On Debian: this means being able to edit files under /etc/apache2</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26783</div></div>
784</li>
785<li>
786<p>
787can restart it.
788</p>
789<div class="literalblock">
790<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49791<pre><tt>'apachectl --graceful' might do. If it doesn't, just stop and
Junio C Hamanof2b74942012-11-20 21:06:26792restart apache. Be warning that active connections to your server
Junio C Hamano61525f92014-01-17 22:46:49793might be aborted by this.</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26794</div></div>
795<div class="literalblock">
796<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49797<pre><tt>On Debian:
Junio C Hamanof2b74942012-11-20 21:06:26798 $ /etc/init.d/apache2 restart
799or
800 $ /etc/init.d/apache2 force-reload
801 (which seems to do the same)
802This adds symlinks from the /etc/apache2/mods-enabled to
Junio C Hamano61525f92014-01-17 22:46:49803/etc/apache2/mods-available.</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26804</div></div>
805</li>
806<li>
807<p>
808have permissions to chown a directory
809</p>
810</li>
811<li>
812<p>
Junio C Hamano076ffcc2013-02-06 05:13:21813have Git installed on the client, and
Junio C Hamanof2b74942012-11-20 21:06:26814</p>
815</li>
816<li>
817<p>
Junio C Hamano076ffcc2013-02-06 05:13:21818either have Git installed on the server or have a webdav client on
Junio C Hamanof2b74942012-11-20 21:06:26819 the client.
820</p>
821</li>
822</ul></div>
823<div class="paragraph"><p>In effect, this means you&#8217;re going to be root, or that you&#8217;re using a
824preconfigured WebDAV server.</p></div>
825</div>
826</div>
Junio C Hamano9d971152012-12-19 00:43:11827<div class="sect1">
Junio C Hamano076ffcc2013-02-06 05:13:21828<h2 id="_step_1_setup_a_bare_git_repository">Step 1: setup a bare Git repository</h2>
Junio C Hamanof2b74942012-11-20 21:06:26829<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21830<div class="paragraph"><p>At the time of writing, git-http-push cannot remotely create a Git
831repository. So we have to do that at the server side with Git. Another
Junio C Hamanof2b74942012-11-20 21:06:26832option is to generate an empty bare repository at the client and copy
833it to the server with a WebDAV client (which is the only option if Git
834is not installed on the server).</p></div>
835<div class="paragraph"><p>Create the directory under the DocumentRoot of the directories served
836by Apache. As an example we take /usr/local/apache2, but try "grep
837DocumentRoot /where/ever/httpd.conf" to find your root:</p></div>
838<div class="literalblock">
839<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49840<pre><tt>$ cd /usr/local/apache/htdocs
841$ mkdir my-new-repo.git</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26842</div></div>
843<div class="literalblock">
844<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49845<pre><tt>On Debian:</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26846</div></div>
847<div class="literalblock">
848<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49849<pre><tt>$ cd /var/www
850$ mkdir my-new-repo.git</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26851</div></div>
852<div class="paragraph"><p>Initialize a bare repository</p></div>
853<div class="literalblock">
854<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49855<pre><tt>$ cd my-new-repo.git
856$ git --bare init</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26857</div></div>
Junio C Hamano61525f92014-01-17 22:46:49858<div class="paragraph"><p>Change the ownership to your web-server&#8217;s credentials. Use <tt>"grep ^User
859httpd.conf"</tt> and <tt>"grep ^Group httpd.conf"</tt> to find out:</p></div>
Junio C Hamanof2b74942012-11-20 21:06:26860<div class="literalblock">
861<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49862<pre><tt>$ chown -R www.www .</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26863</div></div>
864<div class="literalblock">
865<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49866<pre><tt>On Debian:</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26867</div></div>
868<div class="literalblock">
869<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49870<pre><tt>$ chown -R www-data.www-data .</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26871</div></div>
872<div class="paragraph"><p>If you do not know which user Apache runs as, you can alternatively do
873a "chmod -R a+w .", inspect the files which are created later on, and
874set the permissions appropriately.</p></div>
875<div class="paragraph"><p>Restart apache2, and check whether <a href="http://server/my-new-repo.git">http://server/my-new-repo.git</a> gives
876a directory listing. If not, check whether apache started up
877successfully.</p></div>
878</div>
Junio C Hamano9d971152012-12-19 00:43:11879</div>
880<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:26881<h2 id="_step_2_enable_dav_on_this_repository">Step 2: enable DAV on this repository</h2>
882<div class="sectionbody">
883<div class="paragraph"><p>First make sure the dav_module is loaded. For this, insert in httpd.conf:</p></div>
884<div class="literalblock">
885<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49886<pre><tt>LoadModule dav_module libexec/httpd/libdav.so
887AddModule mod_dav.c</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26888</div></div>
889<div class="paragraph"><p>Also make sure that this line exists which is the file used for
890locking DAV operations:</p></div>
891<div class="literalblock">
892<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49893<pre><tt>DAVLockDB "/usr/local/apache2/temp/DAV.lock"</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26894</div></div>
895<div class="literalblock">
896<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49897<pre><tt>On Debian these steps can be performed with:</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26898</div></div>
899<div class="literalblock">
900<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49901<pre><tt>Enable the dav and dav_fs modules of apache:
Junio C Hamanof2b74942012-11-20 21:06:26902$ a2enmod dav_fs
903(just to be sure. dav_fs might be unneeded, I don't know)
904$ a2enmod dav
905The DAV lock is located in /etc/apache2/mods-available/dav_fs.conf:
Junio C Hamano61525f92014-01-17 22:46:49906 DAVLockDB /var/lock/apache2/DAVLock</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26907</div></div>
908<div class="paragraph"><p>Of course, it can point somewhere else, but the string is actually just a
909prefix in some Apache configurations, and therefore the <em>directory</em> has to
910be writable by the user Apache runs as.</p></div>
911<div class="paragraph"><p>Then, add something like this to your httpd.conf</p></div>
912<div class="literalblock">
913<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49914<pre><tt>&lt;Location /my-new-repo.git&gt;
Junio C Hamanof2b74942012-11-20 21:06:26915 DAV on
916 AuthType Basic
917 AuthName "Git"
918 AuthUserFile /usr/local/apache2/conf/passwd.git
919 Require valid-user
Junio C Hamano61525f92014-01-17 22:46:49920&lt;/Location&gt;</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26921</div></div>
922<div class="literalblock">
923<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49924<pre><tt>On Debian:
925 Create (or add to) /etc/apache2/conf.d/git.conf :</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26926</div></div>
927<div class="literalblock">
928<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49929<pre><tt>&lt;Location /my-new-repo.git&gt;
Junio C Hamanof2b74942012-11-20 21:06:26930 DAV on
931 AuthType Basic
932 AuthName "Git"
933 AuthUserFile /etc/apache2/passwd.git
934 Require valid-user
Junio C Hamano61525f92014-01-17 22:46:49935&lt;/Location&gt;</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26936</div></div>
937<div class="literalblock">
938<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49939<pre><tt>Debian automatically reads all files under /etc/apache2/conf.d.</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26940</div></div>
941<div class="paragraph"><p>The password file can be somewhere else, but it has to be readable by
942Apache and preferably not readable by the world.</p></div>
943<div class="paragraph"><p>Create this file by
944 $ htpasswd -c /usr/local/apache2/conf/passwd.git &lt;user&gt;</p></div>
945<div class="literalblock">
946<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49947<pre><tt>On Debian:
948 $ htpasswd -c /etc/apache2/passwd.git &lt;user&gt;</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26949</div></div>
950<div class="paragraph"><p>You will be asked a password, and the file is created. Subsequent calls
951to htpasswd should omit the <em>-c</em> option, since you want to append to the
952existing file.</p></div>
953<div class="paragraph"><p>You need to restart Apache.</p></div>
954<div class="paragraph"><p>Now go to <a href="http://&lt;username&gt;@&lt;servername&gt;/my-new-repo.git">http://&lt;username&gt;@&lt;servername&gt;/my-new-repo.git</a> in your
955browser to check whether it asks for a password and accepts the right
956password.</p></div>
957<div class="paragraph"><p>On Debian:</p></div>
958<div class="literalblock">
959<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49960<pre><tt>To test the WebDAV part, do:</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26961</div></div>
962<div class="literalblock">
963<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49964<pre><tt>$ apt-get install litmus
965$ litmus http://&lt;servername&gt;/my-new-repo.git &lt;username&gt; &lt;password&gt;</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26966</div></div>
967<div class="literalblock">
968<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49969<pre><tt>Most tests should pass.</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26970</div></div>
971<div class="paragraph"><p>A command line tool to test WebDAV is cadaver. If you prefer GUIs, for
972example, konqueror can open WebDAV URLs as "webdav://&#8230;" or
973"webdavs://&#8230;".</p></div>
974<div class="paragraph"><p>If you&#8217;re into Windows, from XP onwards Internet Explorer supports
975WebDAV. For this, do Internet Explorer &#8594; Open Location &#8594;
976<a href="http://&lt;servername&gt;/my-new-repo.git">http://&lt;servername&gt;/my-new-repo.git</a> [x] Open as webfolder &#8594; login .</p></div>
977</div>
Junio C Hamano9d971152012-12-19 00:43:11978</div>
979<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:26980<h2 id="_step_3_setup_the_client">Step 3: setup the client</h2>
981<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21982<div class="paragraph"><p>Make sure that you have HTTP support, i.e. your Git was built with
Junio C Hamanof2b74942012-11-20 21:06:26983libcurl (version more recent than 7.10). The command <em>git http-push</em> with
984no argument should display a usage message.</p></div>
985<div class="paragraph"><p>Then, add the following to your $HOME/.netrc (you can do without, but will be
986asked to input your password a <em>lot</em> of times):</p></div>
987<div class="literalblock">
988<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49989<pre><tt>machine &lt;servername&gt;
Junio C Hamanof2b74942012-11-20 21:06:26990login &lt;username&gt;
Junio C Hamano61525f92014-01-17 22:46:49991password &lt;password&gt;</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:26992</div></div>
993<div class="paragraph"><p>&#8230;and set permissions:
994 chmod 600 ~/.netrc</p></div>
995<div class="paragraph"><p>If you want to access the web-server by its IP, you have to type that in,
996instead of the server name.</p></div>
997<div class="paragraph"><p>To check whether all is OK, do:</p></div>
998<div class="literalblock">
999<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491000<pre><tt>curl --netrc --location -v http://&lt;username&gt;@&lt;servername&gt;/my-new-repo.git/HEAD</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:261001</div></div>
1002<div class="paragraph"><p>&#8230;this should give something like <em>ref: refs/heads/master</em>, which is
1003the content of the file HEAD on the server.</p></div>
1004<div class="paragraph"><p>Now, add the remote in your existing repository which contains the project
1005you want to export:</p></div>
1006<div class="literalblock">
1007<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491008<pre><tt>$ git-config remote.upload.url \
1009 http://&lt;username&gt;@&lt;servername&gt;/my-new-repo.git/</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:261010</div></div>
1011<div class="paragraph"><p>It is important to put the last <em>/</em>; Without it, the server will send
1012a redirect which git-http-push does not (yet) understand, and git-http-push
1013will repeat the request infinitely.</p></div>
1014</div>
Junio C Hamano9d971152012-12-19 00:43:111015</div>
1016<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:261017<h2 id="_step_4_make_the_initial_push">Step 4: make the initial push</h2>
1018<div class="sectionbody">
1019<div class="paragraph"><p>From your client repository, do</p></div>
1020<div class="literalblock">
1021<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491022<pre><tt>$ git push upload master</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:261023</div></div>
1024<div class="paragraph"><p>This pushes branch <em>master</em> (which is assumed to be the branch you
1025want to export) to repository called <em>upload</em>, which we previously
1026defined with git-config.</p></div>
1027</div>
Junio C Hamano9d971152012-12-19 00:43:111028</div>
1029<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:261030<h2 id="_using_a_proxy">Using a proxy:</h2>
1031<div class="sectionbody">
1032<div class="paragraph"><p>If you have to access the WebDAV server from behind an HTTP(S) proxy,
1033set the variable <em>all_proxy</em> to <em>http://proxy-host.com:port</em>, or
1034<em>http://login-on-proxy:passwd-on-proxy@proxy-host.com:port</em>. See <em>man
1035curl</em> for details.</p></div>
1036</div>
Junio C Hamano9d971152012-12-19 00:43:111037</div>
1038<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:261039<h2 id="_troubleshooting">Troubleshooting:</h2>
1040<div class="sectionbody">
1041<div class="paragraph"><p>If git-http-push says</p></div>
1042<div class="literalblock">
1043<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491044<pre><tt>Error: no DAV locking support on remote repo http://...</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:261045</div></div>
1046<div class="paragraph"><p>then it means the web-server did not accept your authentication. Make sure
1047that the user name and password matches in httpd.conf, .netrc and the URL
1048you are uploading to.</p></div>
1049<div class="paragraph"><p>If git-http-push shows you an error (22/502) when trying to MOVE a blob,
1050it means that your web-server somehow does not recognize its name in the
1051request; This can happen when you start Apache, but then disable the
1052network interface. A simple restart of Apache helps.</p></div>
1053<div class="paragraph"><p>Errors like (22/502) are of format (curl error code/http error
1054code). So (22/404) means something like <em>not found</em> at the server.</p></div>
1055<div class="paragraph"><p>Reading /usr/local/apache2/logs/error_log is often helpful.</p></div>
1056<div class="literalblock">
1057<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491058<pre><tt>On Debian: Read /var/log/apache2/error.log instead.</tt></pre>
Junio C Hamanof2b74942012-11-20 21:06:261059</div></div>
Junio C Hamano076ffcc2013-02-06 05:13:211060<div class="paragraph"><p>If you access HTTPS locations, Git may fail verifying the SSL
Junio C Hamanof2b74942012-11-20 21:06:261061certificate (this is return code 60). Setting http.sslVerify=false can
1062help diagnosing the problem, but removes security checks.</p></div>
1063<div class="paragraph"><p>Debian References: <a href="http://www.debian-administration.org/articles/285">http://www.debian-administration.org/articles/285</a></p></div>
1064<div class="paragraph"><p>Authors
1065 Johannes Schindelin &lt;<a href="mailto:Johannes.Schindelin@gmx.de">Johannes.Schindelin@gmx.de</a>&gt;
1066 Rutger Nijlunsing &lt;<a href="mailto:git@wingding.demon.nl">git@wingding.demon.nl</a>&gt;
1067 Matthieu Moy &lt;<a href="mailto:Matthieu.Moy@imag.fr">Matthieu.Moy@imag.fr</a>&gt;</p></div>
1068</div>
1069</div>
Junio C Hamano9d971152012-12-19 00:43:111070</div>
Junio C Hamanof2b74942012-11-20 21:06:261071<div id="footnotes"><hr /></div>
1072<div id="footer">
1073<div id="footer-text">
Junio C Hamano796c55f2014-05-02 21:45:151074Last updated 2014-05-02 14:42:43 PDT
Junio C Hamanof2b74942012-11-20 21:06:261075</div>
1076</div>
1077</body>
1078</html>