<六>. 配置Apache对SVN的支持
1. 命令:vi /usr/local/apache/conf/httpd.conf
追加:
#Append the SVN Usage
<Location /svn/CRM> #SVN访问URL前缀
DAV svn
SVNPath /opt/svn/project/CRM #SVN的路径
AuthType Basic #SVN授权
AuthName "Subversion For CRM" #授权提示
#授权文件配置(指定文件的位置)
AuthzSVNAccessFile /opt/svn/project/CRM/conf/authz
AuthUserFile /opt/svn/project/CRM/conf/passwd
#合法用户才能访问
Require valid-user
</Location>
<七>. 添加SVN用户
(使用Apache的htpasswd命令)
1. 首次添加:设置参数-c
htpasswd -c /opt/svn/project/CRM/conf/passwd James
2. 再次添加:
/usr/local/apache/bin/htpasswd /opt/svn/project/CRM/conf/passwd Nicky
/usr/local/apache/bin/htpasswd /opt/svn/project/CRM/conf/passwd Bill
/usr/local/apache/bin/htpasswd /opt/svn/project/CRM/conf/passwd Jobs
<八>. 权限分配
1. 命令:vi /opt/svn/project/CRM/conf/authz
编辑如下(注意:行前不能有缩进)
#Group and Users
[groups]
g_admin=Nicky
g_programmer=Bill,Jobs
#Access Control
[/]
@g_admin = rw
* = r
[/project/src]
@g_programmer = rw
[/project/test]
James = rw
<九>. 通过Apache使用SVN服务
0. 登录:su - nick
1. 启动Apache:/usr/local/apache/bin/apachectl -k start
2. “首次”启动报错:Unknown DAV provider: svn
[解决] 在httpd.conf文件追加如下内容:vi /usr/local/apache/conf/httpd.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
3. 通过Win浏览器访问:http://192.168.127.11:8088/svn/CRM/