Skip to content

Commit 887985d

Browse files
authored
Merge pull request #702 from johnhar/master
Fixes #312
2 parents 62f8c46 + a1d780a commit 887985d

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

book/04-git-server/sections/git-daemon.asc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Basically, you need to run this command in a daemonized manner:(((git commands,
1313

1414
[source,console]
1515
----
16-
$ git daemon --reuseaddr --base-path=/opt/git/ /opt/git/
16+
$ git daemon --reuseaddr --base-path=/srv/git/ /srv/git/
1717
----
1818

1919
`--reuseaddr` allows the server to restart without waiting for old connections to time out, the `--base-path` option allows people to clone projects without specifying the entire path, and the path at the end tells the Git daemon where to look for repositories to export.
@@ -37,8 +37,8 @@ stop on shutdown
3737
exec /usr/bin/git daemon \
3838
--user=git --group=git \
3939
--reuseaddr \
40-
--base-path=/opt/git/ \
41-
/opt/git/
40+
--base-path=/srv/git/ \
41+
/srv/git/
4242
respawn
4343
----
4444

book/04-git-server/sections/gitweb.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ First, you need to get the Git source code, which GitWeb comes with, and generat
3838
----
3939
$ git clone git://git.kernel.org/pub/scm/git/git.git
4040
$ cd git/
41-
$ make GITWEB_PROJECTROOT="/opt/git" prefix=/usr gitweb
41+
$ make GITWEB_PROJECTROOT="/srv/git" prefix=/usr gitweb
4242
SUBDIR gitweb
4343
SUBDIR ../
4444
make[2]: `GIT-VERSION-FILE' is up to date.

book/04-git-server/sections/protocols.asc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ For example, to clone a local repository, you can run something like this:
1616

1717
[source,console]
1818
----
19-
$ git clone /opt/git/project.git
19+
$ git clone /srv/git/project.git
2020
----
2121

2222
Or you can do this:
2323

2424
[source,console]
2525
----
26-
$ git clone file:///opt/git/project.git
26+
$ git clone file:///srv/git/project.git
2727
----
2828

2929
Git operates slightly differently if you explicitly specify `file://` at the beginning of the URL.
@@ -36,7 +36,7 @@ To add a local repository to an existing Git project, you can run something like
3636

3737
[source,console]
3838
----
39-
$ git remote add local_proj /opt/git/project.git
39+
$ git remote add local_proj /srv/git/project.git
4040
----
4141

4242
Then, you can push to and pull from that remote as though you were doing so over a network.

book/04-git-server/sections/setting-up-server.asc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ Now, you can set up an empty repository for them by running `git init` with the
4343

4444
[source,console]
4545
----
46-
$ cd /opt/git
46+
$ cd /srv/git
4747
$ mkdir project.git
4848
$ cd project.git
4949
$ git init --bare
50-
Initialized empty Git repository in /opt/git/project.git/
50+
Initialized empty Git repository in /srv/git/project.git/
5151
----
5252

5353
Then, John, Josie, or Jessica can push the first version of their project into that repository by adding it as a remote and pushing up a branch.
@@ -62,15 +62,15 @@ $ cd myproject
6262
$ git init
6363
$ git add .
6464
$ git commit -m 'initial commit'
65-
$ git remote add origin git@gitserver:/opt/git/project.git
65+
$ git remote add origin git@gitserver:/srv/git/project.git
6666
$ git push origin master
6767
----
6868

6969
At this point, the others can clone it down and push changes back up just as easily:
7070

7171
[source,console]
7272
----
73-
$ git clone git@gitserver:/opt/git/project.git
73+
$ git clone git@gitserver:/srv/git/project.git
7474
$ cd project
7575
$ vim README
7676
$ git commit -am 'fix for the README file'

book/04-git-server/sections/smart-http.asc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ $ a2enmod cgi alias env rewrite
1818

1919
This also enables the `mod_cgi`, `mod_alias`, `mod_env`, and `mod_rewrite` modules, which are all needed for this to work properly.
2020

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:
21+
You’ll also need to set the Unix user group of the `/srv/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:
2222

2323
[source,console]
2424
----
25-
$ chgrp -R www-data /opt/git
25+
$ chgrp -R www-data /srv/git
2626
----
2727

2828
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.
2929

3030
[source,console]
3131
----
32-
SetEnv GIT_PROJECT_ROOT /opt/git
32+
SetEnv GIT_PROJECT_ROOT /srv/git
3333
SetEnv GIT_HTTP_EXPORT_ALL
3434
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
3535
----
@@ -48,7 +48,7 @@ RewriteRule ^/git/ - [E=AUTHREQUIRED]
4848
<Files "git-http-backend">
4949
AuthType Basic
5050
AuthName "Git Access"
51-
AuthUserFile /opt/git/.htpasswd
51+
AuthUserFile /srv/git/.htpasswd
5252
Require valid-user
5353
Order deny,allow
5454
Deny from env=AUTHREQUIRED
@@ -61,7 +61,7 @@ Here is an example of adding a ``schacon'' user to the file:
6161

6262
[source,console]
6363
----
64-
$ htpasswd -c /opt/git/.htpasswd schacon
64+
$ htpasswd -c /srv/git/.htpasswd schacon
6565
----
6666

6767
There are tons of ways to have Apache authenticate users, you'll have to choose and implement one of them.

0 commit comments

Comments
 (0)