1. Install subversion. (recommend using windows binary, as it will automatically add subversion's bin folder to PATH, save yourself some trouble)
2. Create subversion as an automatic windows services.
sc create svnserver binpath= "d:\svn\bin\svnserve.exe --service -r d:\svn\repository" displayname= "Subversion" depend= Tcpip start= auto
This saves you to remember to start subversion every time.
3. Create a source repository.
svnadmin create "d:\svn\repository".
Bear in mind, you could create a repository anywhere you want. After doing that, you should find a bunch of files are created under d:\svn\repository.
4. Configure for subversion only installation. If you install subversion with Apache, skip this step.
a. d:\svn\repository\conf/svnserve.conf, uncomment the following lines:
anon-access = none
auth-access = write
password-db = passwd
b. d:\svn\repository\passwd
you can add user here in the following format:
haibo=secret
anon-access = none
auth-access = write
password-db = passwd
b. d:\svn\repository\passwd
you can add user here in the following format:
haibo=secret
5. Install Apache Sever, if you don't want to use port 80, change \Apache2.2\httpd.conf,
Listen 8181
At this point, Apache knows nothing about subversion.
6. Configure Apache with Subversion.
a. open D:\Apache Software Foundation\Apache2.2\httpd.conf, add the following at the end of the file
Listen 8181
At this point, Apache knows nothing about subversion.
6. Configure Apache with Subversion.
a. open D:\Apache Software Foundation\Apache2.2\httpd.conf, add the following at the end of the file
#load moules for svn
LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module "D:/svn/bin/mod_dav_svn.so"
LoadModule authz_svn_module "D:/svn/bin/mod_authz_svn.so"
# Configure Subversion repository
<Location /repository2>
DAV svn
SVNPath "D:\svn\repository2"
AuthType Basic
AuthName "Subversion Repository2"
AuthUserFile "D:\svn_conf\passwd"
Require valid-user
AuthzSVNAccessFile D:\svn_conf\svn-acl
</Location>
For "Configure Subversion repository" part, you could put it into another by doing this
Include D:/svn_conf/subversion.conf
7. Now we need configure D:\svn_conf\passwd and D:\svn_conf\svn-acl.
cd D:\Apache Software Foundation\Apache2.2\bin
htpasswd -cm d:\svn_conf\passwd Sam
this is create an encrypted password for user "Sam", it will prompt your to enter password.
If you want to add another, htpasswd -m d:\svn_conf\passwd haibo
Be noted, we are not using -c option here, otherwise, it will remove user Sam.
Then create D:\svn_conf\svn-acl, this file will define which users have what access.
[repository:/]
Sam = rw
* = r
[repository2:/]
Sam = rw
* = r
htpasswd -cm d:\svn_conf\passwd Sam
this is create an encrypted password for user "Sam", it will prompt your to enter password.
If you want to add another, htpasswd -m d:\svn_conf\passwd haibo
Be noted, we are not using -c option here, otherwise, it will remove user Sam.
Then create D:\svn_conf\svn-acl, this file will define which users have what access.
[repository:/]
Sam = rw
* = r
[repository2:/]
Sam = rw
* = r
8. Now, start Apache Sever, your url should be:
http://localhost:8181/repository2/
http://localhost:8181/repository2/