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
Copy file name to clipboardExpand all lines: book/04-git-server/sections/smart-http.asc
+20-17Lines changed: 20 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,17 @@ 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
+
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:
22
+
23
+
[source,console]
24
+
----
25
+
$ chgrp -R www-data /opt/git
26
+
----
20
27
21
28
Next we need to add some things to the Apache configuration to run the `git-http-backend` as the handler for anything coming into the `/git` path of your web server.
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.
31
38
32
-
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:
33
40
34
41
[source,console]
35
42
----
36
-
<Directory "/usr/lib/git-core*">
37
-
Options ExecCGI Indexes
38
-
Order allow,deny
39
-
Allow from all
40
-
Require all granted
41
-
</Directory>
42
-
----
43
-
44
-
Finally you'll want to make writes be authenticated somehow, possibly with an Auth block like this:
0 commit comments