一、Apache2.2.14\conf\httpd.conf 添加如下内容:
#解决httpd: Could not reliably determine the server's fully qualified domain name
ServerName localhost:80
Listen 80
ServerAdmin shenjc@foxmail.com
#DocumentRoot必须设置,否则会报403错误
DocumentRoot "D:/Development_Tools/Apache2.2.14/htdocs"
#DocumentRoot "D:/Tomcat 5.5/webapps/food"
#您的站点项目所在路径,应与tomcat中的目录设置相同
#Alias /food_bestech "D:/Tomcat 5.5/webapps/food"
#整合apache和svn
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_svn_module "D:/Development_Tools/Subversion/bin/mod_dav_svn.so"
LoadModule authz_svn_module "D:/Development_Tools/Subversion/bin/mod_authz_svn.so"
<Location /svn>
#引用远程访问模块
DAV svn
#版本库路径
SVNListParentPath on
SVNParentPath E:/svn_http
#激活基本认证,就是用户名/密码
AuthType Basic
#用来说明何时弹出要求用户输入认证信息的认证对话框
AuthName "Subversion repositories"
#指定使用的认证密码文件
AuthUserFile E:/svn_http/conf/passwd.ini
#位置Subversion版本库的访问控制文件的路径
AuthzSVNAccessFile E:/svn_http/conf/authz.ini
#指定只有输入了正确的用户/密码的用户可以访问URL
Require valid-user
</Location>
二、创建用户
D:\Development_Tools\Apache2.2.14\bin>htpasswd -c E:\svn_http\conf\passwd.ini shenjc
Automatically using MD5 format.
New password: ******
Re-type new password: ******
Adding password for user shenjc
D:\Development_Tools\Apache2.2.14\bin>htpasswd E:\svn_http\conf\passwd.ini shenjc_test
Automatically using MD5 format.
New password: ******
Re-type new password: ******
Adding password for user shenjc_test
D:\Development_Tools\Apache2.2.14\bin>htpasswd E:\svn_http\conf\passwd.ini admin
Automatically using MD5 format.
New password: ******
Re-type new password: ******
Adding password for user admin
三、授权文件设置
authz.ini内容:
[groups]
admin=admin,shenjc
developers=shenjc,shenjc2
pm=shenjc_pm
testers=shenjc_test
#预置设置
[/]
*=r
@admin=rw
dangerman=
#多个项目配置,一级目录权限
[repo1:/]
@admin=rw
@developers=r
#branches二级目录权限
[/branches]
@testers=r
@developers=rw
#tags二级目录权限
[/tags]
@admin=rw
@pm=rw
#trunk二级目录权限
[/trunk]
@admin=rw
@developers=rw
#特殊设置
[repo1:/flight]
shenjc=rw
@developers=rw
* =
四、创建仓库:
D:\Development_Tools\Subversion\bin>svnadmin create E:\svn_http\repo1
五、访问地址
http://localhost/svn/repo1