1 # dav_svn.conf - Example Subversion/Apache configuration
2 #
3 # For details and further options see the Apache user manual and
4 # the Subversion book.
5 #
6 # NOTE: for a setup with multiple vhosts, you will want to do this
7 # configuration in /etc/apache2/sites-available/*, not here.
8
9 # ...
10 # URL controls how the repository appears to the outside world.
11 # In this example clients access the repository as http://hostname/svn/
12 # Note, a literal /svn should NOT exist in your document root.
13
14 #设置访问路径
15
16
17 # Uncomment this to enable the repository
18 #启用
19 DAV svn
20
21 # Set this to the path to your repository
22 #设置储存库路径,仅支持单个储存库,该路径要可被Apache进程访问。
23 SVNPath /home/machine/svn/aviation
24 # Alternatively, use SVNParentPath if you have multiple repositories under
25 # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
26 # You need either SVNPath and SVNParentPath, but not both.
27 #SVNParentPath /var/lib/svn
28
29 # Access control is done at 3 levels: (1) Apache authentication, via
30 # any of several methods. A "Basic Auth" section is commented out
31 # below. (2) Apache and , also commented out
32 # below. (3) mod_authz_svn is a svn-specific authorization module
33 # which offers fine-grained read/write access control for paths
34 # within a repository. (The first two layers are coarse-grained; you
35 # can only enable/disable access to an entire repository.) Note that
36 # mod_authz_svn is noticeably slower than the other two layers, so if
37 # you don't need the fine-grained control, don't configure it.
38
39 # Basic Authentication is repository-wide. It is not secure unless
40 # you are using https. See the 'htpasswd' command to create and
41 # manage the password file - and the documentation for the
42 # 'auth_basic' and 'authn_file' modules, which you will need for this
43 # (enable them with 'a2enmod').
44 #启用Apache基础验证
45 AuthType Basic
46 #设置验证框标题
47 AuthName "Subversion Repository"
48 #指定验证用户文件名
49 AuthUserFile /etc/apache2/dav_svn.passwd
50
51 # To enable authorization via mod_authz_svn
52 #启用目录级别授权,dav_svn.authz是授权配置文档
53 #AuthzSVNAccessFile /etc/apache2/dav_svn.authz
54
55 # The following three lines allow anonymous read, but make
56 # committers authenticate themselves. It requires the 'authz_user'
57 # module (enable it with 'a2enmod').
58 #
59 #允许匿名访问,不允许Commit,不能与AuthzSVNAccessFile同时使用
60 Require valid-user
61 #
62
63 权限修改
修改/home/machine/jdeproject/aviation/目录访问权限使它可被Apache进程访问,也就是其他用户可访问.
htpasswd -c /etc/apache2/dev_svn.passwd machine
New password:
Re-type new password:
#省略添加其他用户的过程,注意参数,首次创建需要-c,增加的时候只要-d
htpasswd -d /etc/apache2/dev_svn.passwd song
New password:
Re-type new password:使用
现在可以在浏览器中输入http://127.0.0.1/aviation访问源代码,可以使用svn客户端管理源代码了。:)