blob: 6d498112eda42d047dd6cffaa0e885976aa7cdd8 [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" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
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 Hamano9d971152012-12-19 00:43:1190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamanof2b74942012-11-20 21:06:2694 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9d971152012-12-19 00:43:1198
99#author {
Junio C Hamanof2b74942012-11-20 21:06:26100 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26101 font-weight: bold;
102 font-size: 1.1em;
103}
Junio C Hamano9d971152012-12-19 00:43:11104#email {
Junio C Hamanof2b74942012-11-20 21:06:26105}
Junio C Hamano9d971152012-12-19 00:43:11106#revnumber, #revdate, #revremark {
Junio C Hamanof2b74942012-11-20 21:06:26107}
108
Junio C Hamano9d971152012-12-19 00:43:11109#footer {
Junio C Hamanof2b74942012-11-20 21:06:26110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-text {
Junio C Hamanof2b74942012-11-20 21:06:26116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9d971152012-12-19 00:43:11119#footer-badges {
Junio C Hamanof2b74942012-11-20 21:06:26120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9d971152012-12-19 00:43:11124#preamble {
Junio C Hamanof2b74942012-11-20 21:06:26125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9d971152012-12-19 00:43:11128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamanof2b74942012-11-20 21:06:26129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
131 margin-top: 1.0em;
132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
147 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamanof2b74942012-11-20 21:06:26171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamanof2b74942012-11-20 21:06:26178 padding: 0.5em;
179}
180
181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
184 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamanof2b74942012-11-20 21:06:26187}
188
189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
191 text-align: right;
192}
193
Junio C Hamano9d971152012-12-19 00:43:11194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamanof2b74942012-11-20 21:06:26197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
203div.verseblock + div.attribution {
204 text-align: left;
205}
206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
217 border-left: 3px solid #dddddd;
218}
219
220div.exampleblock > div.content {
221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
223}
224
225div.imageblock div.content { padding-left: 0; }
226span.image img { border-style: none; }
227a.image:visited { color: white; }
228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
236 font-style: normal;
237 color: navy;
238}
239dd > *:first-child {
240 margin-top: 0.1em;
241}
242
243ul, ol {
244 list-style-position: outside;
245}
246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
250 list-style-type: lower-alpha;
251}
252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
268
Junio C Hamanof2b74942012-11-20 21:06:26269tfoot {
270 font-weight: bold;
271}
272td > div.verse {
273 white-space: pre;
274}
Junio C Hamanof2b74942012-11-20 21:06:26275
276div.hdlist {
277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
280div.hdlist tr {
281 padding-bottom: 15px;
282}
283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
287 vertical-align: top;
288 font-style: normal;
289 padding-right: 0.8em;
290 color: navy;
291}
292td.hdlist2 {
293 vertical-align: top;
294}
295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
303
304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9d971152012-12-19 00:43:11331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamanof2b74942012-11-20 21:06:26338}
339
Junio C Hamano9d971152012-12-19 00:43:11340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamanof2b74942012-11-20 21:06:26345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9d971152012-12-19 00:43:11348#toctitle {
Junio C Hamanof2b74942012-11-20 21:06:26349 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9d971152012-12-19 00:43:11356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanof2b74942012-11-20 21:06:26357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamanof2b74942012-11-20 21:06:26372
Junio C Hamano9d971152012-12-19 00:43:11373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.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
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26478}
479
Junio C Hamano9d971152012-12-19 00:43:11480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
Junio C Hamanof2b74942012-11-20 21:06:26499 text-align: right;
500}
501
Junio C Hamano9d971152012-12-19 00:43:11502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
Junio C Hamanof2b74942012-11-20 21:06:26504}
Junio C Hamano9d971152012-12-19 00:43:11505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
Junio C Hamanof2b74942012-11-20 21:06:26510}
511
Junio C Hamano9d971152012-12-19 00:43:11512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
524body.manpage h2 {
525 border-style: none;
526}
527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamanof2b74942012-11-20 21:06:26529}
530
Junio C Hamano9d971152012-12-19 00:43:11531@media print {
532 body.manpage div#toc { display: none; }
533}
534
535
Junio C Hamanof2b74942012-11-20 21:06:26536</style>
537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamanof2b74942012-11-20 21:06:26539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9d971152012-12-19 00:43:11580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamanof2b74942012-11-20 21:06:26581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamanof2b74942012-11-20 21:06:26619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamanof2b74942012-11-20 21:06:26648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamanof2b74942012-11-20 21:06:26664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9d971152012-12-19 00:43:11670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamanof2b74942012-11-20 21:06:26680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamanof2b74942012-11-20 21:06:26684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9d971152012-12-19 00:43:11703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamanof2b74942012-11-20 21:06:26725}
726
727}
Junio C Hamano9d971152012-12-19 00:43:11728asciidoc.install();
Junio C Hamanof2b74942012-11-20 21:06:26729/*]]>*/
730</script>
731</head>
Junio C Hamano9d971152012-12-19 00:43:11732<body class="article">
Junio C Hamanof2b74942012-11-20 21:06:26733<div id="header">
Junio C Hamano076ffcc2013-02-06 05:13:21734<h1>How to setup Git server over http</h1>
Junio C Hamanof2b74942012-11-20 21:06:26735</div>
736<div id="content">
737<div id="preamble">
738<div class="sectionbody">
Junio C Hamanobf398b72013-11-05 00:40:48739<div class="admonitionblock">
740<table><tr>
741<td class="icon">
742<div class="title">Note</div>
743</td>
744<td class="content">This document is from 2006. A lot has happened since then, and this
745document is now relevant mainly if your web host is not CGI capable.
746Almost everyone else should instead look at linkgit:git-http-backend[1].</td>
747</tr></table>
748</div>
Junio C Hamanof2b74942012-11-20 21:06:26749<div class="paragraph"><p>Since Apache is one of those packages people like to compile
750themselves while others prefer the bureaucrat&#8217;s dream Debian, it is
751impossible to give guidelines which will work for everyone. Just send
752some feedback to the mailing list at <a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a> to get this
753document tailored to your favorite distro.</p></div>
754<div class="paragraph"><p>What&#8217;s needed:</p></div>
755<div class="ulist"><ul>
756<li>
757<p>
758Have an Apache web-server
759</p>
760<div class="literalblock">
761<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11762<pre><code>On Debian:
Junio C Hamanof2b74942012-11-20 21:06:26763 $ apt-get install apache2
764 To get apache2 by default started,
Junio C Hamano9d971152012-12-19 00:43:11765 edit /etc/default/apache2 and set NO_START=0</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26766</div></div>
767</li>
768<li>
769<p>
770can edit the configuration of it.
771</p>
772<div class="literalblock">
773<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11774<pre><code>This could be found under /etc/httpd, or refer to your Apache documentation.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26775</div></div>
776<div class="literalblock">
777<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11778<pre><code>On Debian: this means being able to edit files under /etc/apache2</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26779</div></div>
780</li>
781<li>
782<p>
783can restart it.
784</p>
785<div class="literalblock">
786<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11787<pre><code>'apachectl --graceful' might do. If it doesn't, just stop and
Junio C Hamanof2b74942012-11-20 21:06:26788restart apache. Be warning that active connections to your server
Junio C Hamano9d971152012-12-19 00:43:11789might be aborted by this.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26790</div></div>
791<div class="literalblock">
792<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11793<pre><code>On Debian:
Junio C Hamanof2b74942012-11-20 21:06:26794 $ /etc/init.d/apache2 restart
795or
796 $ /etc/init.d/apache2 force-reload
797 (which seems to do the same)
798This adds symlinks from the /etc/apache2/mods-enabled to
Junio C Hamano9d971152012-12-19 00:43:11799/etc/apache2/mods-available.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26800</div></div>
801</li>
802<li>
803<p>
804have permissions to chown a directory
805</p>
806</li>
807<li>
808<p>
Junio C Hamano076ffcc2013-02-06 05:13:21809have Git installed on the client, and
Junio C Hamanof2b74942012-11-20 21:06:26810</p>
811</li>
812<li>
813<p>
Junio C Hamano076ffcc2013-02-06 05:13:21814either have Git installed on the server or have a webdav client on
Junio C Hamanof2b74942012-11-20 21:06:26815 the client.
816</p>
817</li>
818</ul></div>
819<div class="paragraph"><p>In effect, this means you&#8217;re going to be root, or that you&#8217;re using a
820preconfigured WebDAV server.</p></div>
821</div>
822</div>
Junio C Hamano9d971152012-12-19 00:43:11823<div class="sect1">
Junio C Hamano076ffcc2013-02-06 05:13:21824<h2 id="_step_1_setup_a_bare_git_repository">Step 1: setup a bare Git repository</h2>
Junio C Hamanof2b74942012-11-20 21:06:26825<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21826<div class="paragraph"><p>At the time of writing, git-http-push cannot remotely create a Git
827repository. So we have to do that at the server side with Git. Another
Junio C Hamanof2b74942012-11-20 21:06:26828option is to generate an empty bare repository at the client and copy
829it to the server with a WebDAV client (which is the only option if Git
830is not installed on the server).</p></div>
831<div class="paragraph"><p>Create the directory under the DocumentRoot of the directories served
832by Apache. As an example we take /usr/local/apache2, but try "grep
833DocumentRoot /where/ever/httpd.conf" to find your root:</p></div>
834<div class="literalblock">
835<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11836<pre><code>$ cd /usr/local/apache/htdocs
837$ mkdir my-new-repo.git</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26838</div></div>
839<div class="literalblock">
840<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11841<pre><code>On Debian:</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26842</div></div>
843<div class="literalblock">
844<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11845<pre><code>$ cd /var/www
846$ mkdir my-new-repo.git</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26847</div></div>
848<div class="paragraph"><p>Initialize a bare repository</p></div>
849<div class="literalblock">
850<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11851<pre><code>$ cd my-new-repo.git
852$ git --bare init</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26853</div></div>
Junio C Hamano369e3402013-10-15 18:40:25854<div class="paragraph"><p>Change the ownership to your web-server&#8217;s credentials. Use <code>"grep ^User
855httpd.conf"</code> and <code>"grep ^Group httpd.conf"</code> to find out:</p></div>
Junio C Hamanof2b74942012-11-20 21:06:26856<div class="literalblock">
857<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11858<pre><code>$ chown -R www.www .</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26859</div></div>
860<div class="literalblock">
861<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11862<pre><code>On Debian:</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26863</div></div>
864<div class="literalblock">
865<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11866<pre><code>$ chown -R www-data.www-data .</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26867</div></div>
868<div class="paragraph"><p>If you do not know which user Apache runs as, you can alternatively do
869a "chmod -R a+w .", inspect the files which are created later on, and
870set the permissions appropriately.</p></div>
871<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
872a directory listing. If not, check whether apache started up
873successfully.</p></div>
874</div>
Junio C Hamano9d971152012-12-19 00:43:11875</div>
876<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:26877<h2 id="_step_2_enable_dav_on_this_repository">Step 2: enable DAV on this repository</h2>
878<div class="sectionbody">
879<div class="paragraph"><p>First make sure the dav_module is loaded. For this, insert in httpd.conf:</p></div>
880<div class="literalblock">
881<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11882<pre><code>LoadModule dav_module libexec/httpd/libdav.so
883AddModule mod_dav.c</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26884</div></div>
885<div class="paragraph"><p>Also make sure that this line exists which is the file used for
886locking DAV operations:</p></div>
887<div class="literalblock">
888<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11889<pre><code>DAVLockDB "/usr/local/apache2/temp/DAV.lock"</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26890</div></div>
891<div class="literalblock">
892<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11893<pre><code>On Debian these steps can be performed with:</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26894</div></div>
895<div class="literalblock">
896<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11897<pre><code>Enable the dav and dav_fs modules of apache:
Junio C Hamanof2b74942012-11-20 21:06:26898$ a2enmod dav_fs
899(just to be sure. dav_fs might be unneeded, I don't know)
900$ a2enmod dav
901The DAV lock is located in /etc/apache2/mods-available/dav_fs.conf:
Junio C Hamano9d971152012-12-19 00:43:11902 DAVLockDB /var/lock/apache2/DAVLock</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26903</div></div>
904<div class="paragraph"><p>Of course, it can point somewhere else, but the string is actually just a
905prefix in some Apache configurations, and therefore the <em>directory</em> has to
906be writable by the user Apache runs as.</p></div>
907<div class="paragraph"><p>Then, add something like this to your httpd.conf</p></div>
908<div class="literalblock">
909<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11910<pre><code>&lt;Location /my-new-repo.git&gt;
Junio C Hamanof2b74942012-11-20 21:06:26911 DAV on
912 AuthType Basic
913 AuthName "Git"
914 AuthUserFile /usr/local/apache2/conf/passwd.git
915 Require valid-user
Junio C Hamano9d971152012-12-19 00:43:11916&lt;/Location&gt;</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26917</div></div>
918<div class="literalblock">
919<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11920<pre><code>On Debian:
921 Create (or add to) /etc/apache2/conf.d/git.conf :</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26922</div></div>
923<div class="literalblock">
924<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11925<pre><code>&lt;Location /my-new-repo.git&gt;
Junio C Hamanof2b74942012-11-20 21:06:26926 DAV on
927 AuthType Basic
928 AuthName "Git"
929 AuthUserFile /etc/apache2/passwd.git
930 Require valid-user
Junio C Hamano9d971152012-12-19 00:43:11931&lt;/Location&gt;</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26932</div></div>
933<div class="literalblock">
934<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11935<pre><code>Debian automatically reads all files under /etc/apache2/conf.d.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26936</div></div>
937<div class="paragraph"><p>The password file can be somewhere else, but it has to be readable by
938Apache and preferably not readable by the world.</p></div>
939<div class="paragraph"><p>Create this file by
940 $ htpasswd -c /usr/local/apache2/conf/passwd.git &lt;user&gt;</p></div>
941<div class="literalblock">
942<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11943<pre><code>On Debian:
944 $ htpasswd -c /etc/apache2/passwd.git &lt;user&gt;</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26945</div></div>
946<div class="paragraph"><p>You will be asked a password, and the file is created. Subsequent calls
947to htpasswd should omit the <em>-c</em> option, since you want to append to the
948existing file.</p></div>
949<div class="paragraph"><p>You need to restart Apache.</p></div>
950<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
951browser to check whether it asks for a password and accepts the right
952password.</p></div>
953<div class="paragraph"><p>On Debian:</p></div>
954<div class="literalblock">
955<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11956<pre><code>To test the WebDAV part, do:</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26957</div></div>
958<div class="literalblock">
959<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11960<pre><code>$ apt-get install litmus
961$ litmus http://&lt;servername&gt;/my-new-repo.git &lt;username&gt; &lt;password&gt;</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26962</div></div>
963<div class="literalblock">
964<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11965<pre><code>Most tests should pass.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26966</div></div>
967<div class="paragraph"><p>A command line tool to test WebDAV is cadaver. If you prefer GUIs, for
968example, konqueror can open WebDAV URLs as "webdav://&#8230;" or
969"webdavs://&#8230;".</p></div>
970<div class="paragraph"><p>If you&#8217;re into Windows, from XP onwards Internet Explorer supports
971WebDAV. For this, do Internet Explorer &#8594; Open Location &#8594;
972<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>
973</div>
Junio C Hamano9d971152012-12-19 00:43:11974</div>
975<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:26976<h2 id="_step_3_setup_the_client">Step 3: setup the client</h2>
977<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21978<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:26979libcurl (version more recent than 7.10). The command <em>git http-push</em> with
980no argument should display a usage message.</p></div>
981<div class="paragraph"><p>Then, add the following to your $HOME/.netrc (you can do without, but will be
982asked to input your password a <em>lot</em> of times):</p></div>
983<div class="literalblock">
984<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11985<pre><code>machine &lt;servername&gt;
Junio C Hamanof2b74942012-11-20 21:06:26986login &lt;username&gt;
Junio C Hamano9d971152012-12-19 00:43:11987password &lt;password&gt;</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26988</div></div>
989<div class="paragraph"><p>&#8230;and set permissions:
990 chmod 600 ~/.netrc</p></div>
991<div class="paragraph"><p>If you want to access the web-server by its IP, you have to type that in,
992instead of the server name.</p></div>
993<div class="paragraph"><p>To check whether all is OK, do:</p></div>
994<div class="literalblock">
995<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11996<pre><code>curl --netrc --location -v http://&lt;username&gt;@&lt;servername&gt;/my-new-repo.git/HEAD</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26997</div></div>
998<div class="paragraph"><p>&#8230;this should give something like <em>ref: refs/heads/master</em>, which is
999the content of the file HEAD on the server.</p></div>
1000<div class="paragraph"><p>Now, add the remote in your existing repository which contains the project
1001you want to export:</p></div>
1002<div class="literalblock">
1003<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111004<pre><code>$ git-config remote.upload.url \
1005 http://&lt;username&gt;@&lt;servername&gt;/my-new-repo.git/</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261006</div></div>
1007<div class="paragraph"><p>It is important to put the last <em>/</em>; Without it, the server will send
1008a redirect which git-http-push does not (yet) understand, and git-http-push
1009will repeat the request infinitely.</p></div>
1010</div>
Junio C Hamano9d971152012-12-19 00:43:111011</div>
1012<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:261013<h2 id="_step_4_make_the_initial_push">Step 4: make the initial push</h2>
1014<div class="sectionbody">
1015<div class="paragraph"><p>From your client repository, do</p></div>
1016<div class="literalblock">
1017<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111018<pre><code>$ git push upload master</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261019</div></div>
1020<div class="paragraph"><p>This pushes branch <em>master</em> (which is assumed to be the branch you
1021want to export) to repository called <em>upload</em>, which we previously
1022defined with git-config.</p></div>
1023</div>
Junio C Hamano9d971152012-12-19 00:43:111024</div>
1025<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:261026<h2 id="_using_a_proxy">Using a proxy:</h2>
1027<div class="sectionbody">
1028<div class="paragraph"><p>If you have to access the WebDAV server from behind an HTTP(S) proxy,
1029set the variable <em>all_proxy</em> to <em>http://proxy-host.com:port</em>, or
1030<em>http://login-on-proxy:passwd-on-proxy@proxy-host.com:port</em>. See <em>man
1031curl</em> for details.</p></div>
1032</div>
Junio C Hamano9d971152012-12-19 00:43:111033</div>
1034<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:261035<h2 id="_troubleshooting">Troubleshooting:</h2>
1036<div class="sectionbody">
1037<div class="paragraph"><p>If git-http-push says</p></div>
1038<div class="literalblock">
1039<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111040<pre><code>Error: no DAV locking support on remote repo http://...</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261041</div></div>
1042<div class="paragraph"><p>then it means the web-server did not accept your authentication. Make sure
1043that the user name and password matches in httpd.conf, .netrc and the URL
1044you are uploading to.</p></div>
1045<div class="paragraph"><p>If git-http-push shows you an error (22/502) when trying to MOVE a blob,
1046it means that your web-server somehow does not recognize its name in the
1047request; This can happen when you start Apache, but then disable the
1048network interface. A simple restart of Apache helps.</p></div>
1049<div class="paragraph"><p>Errors like (22/502) are of format (curl error code/http error
1050code). So (22/404) means something like <em>not found</em> at the server.</p></div>
1051<div class="paragraph"><p>Reading /usr/local/apache2/logs/error_log is often helpful.</p></div>
1052<div class="literalblock">
1053<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111054<pre><code>On Debian: Read /var/log/apache2/error.log instead.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261055</div></div>
Junio C Hamano076ffcc2013-02-06 05:13:211056<div class="paragraph"><p>If you access HTTPS locations, Git may fail verifying the SSL
Junio C Hamanof2b74942012-11-20 21:06:261057certificate (this is return code 60). Setting http.sslVerify=false can
1058help diagnosing the problem, but removes security checks.</p></div>
1059<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>
1060<div class="paragraph"><p>Authors
1061 Johannes Schindelin &lt;<a href="mailto:Johannes.Schindelin@gmx.de">Johannes.Schindelin@gmx.de</a>&gt;
1062 Rutger Nijlunsing &lt;<a href="mailto:git@wingding.demon.nl">git@wingding.demon.nl</a>&gt;
1063 Matthieu Moy &lt;<a href="mailto:Matthieu.Moy@imag.fr">Matthieu.Moy@imag.fr</a>&gt;</p></div>
1064</div>
1065</div>
Junio C Hamano9d971152012-12-19 00:43:111066</div>
Junio C Hamanof2b74942012-11-20 21:06:261067<div id="footnotes"><hr /></div>
1068<div id="footer">
1069<div id="footer-text">
Junio C Hamanobf398b72013-11-05 00:40:481070Last updated 2013-11-04 16:39:56 PST
Junio C Hamanof2b74942012-11-20 21:06:261071</div>
1072</div>
1073</body>
1074</html>