You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue with the authentication section. The initial ref
advertisement request will fail without even giving an opportunity for
authentication. This is described in the git-http-backend man page
examples.
Update authentication section according to the example to fix the problem.
Merge the section with the git-core access authorization section for
brevity.
Signed-off-by: Vitaly Kuznetsov <[email protected]>
Copy file name to clipboardExpand all lines: book/04-git-server/sections/smart-http.asc
+12-16Lines changed: 12 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,10 @@ If you don't have Apache setup, you can do so on a Linux box with something like
13
13
[source,console]
14
14
----
15
15
$ sudo apt-get install apache2 apache2-utils
16
-
$ a2enmod cgi alias env
16
+
$ a2enmod cgi alias env rewrite
17
17
----
18
18
19
-
This also enables the `mod_cgi`, `mod_alias`, and `mod_env` modules, which are all needed for this to work properly.
19
+
This also enables the `mod_cgi`, `mod_alias`, `mod_env`, and `mod_rewrite` modules, which are all needed for this to work properly.
20
20
21
21
You’ll also need to set the Unix user group of the `/opt/git` directories to `www-data` so your web server can read- and write-access the repositories, because the Apache instance running the CGI script will (by default) be running as that user:
If you leave out `GIT_HTTP_EXPORT_ALL` environment variable, then Git will only serve to unauthenticated clients the repositories with the `git-daemon-export-ok` file in them, just like the Git daemon did.
38
38
39
-
Then you'll have to tell Apache to allow requests to that path with something like this:
39
+
Finally you'll want to tell Apache to allow requests to `git-http-backend` and make writes be authenticated somehow, possibly with an Auth block like this:
40
40
41
41
[source,console]
42
42
----
43
-
<Directory "/usr/lib/git-core*">
44
-
Options ExecCGI Indexes
45
-
Order allow,deny
46
-
Allow from all
47
-
Require all granted
48
-
</Directory>
49
-
----
50
-
51
-
Finally you'll want to make writes be authenticated somehow, possibly with an Auth block like this:
0 commit comments