Want to show your appreciation? Please to my charity.

Wednesday, March 08, 2006

Subversion with ApacheSSL on Win32

After getting Apache2 + SSL running sucessfully, I started to install subversion.

Install Subversion

Download 1.3.0 installer (the setup.exe version) from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91 and run the executable. The installer not only installed Subversion but also modified the Apache http.conf file by adding two modules and restarted the Apache server.

Create Subversion Repository

Launch a command prompt and run this: svnadmin create c:\svnrepo

Import Source into repository

svn import "C:\path\to\project" file:///svnrepo -m "initial import"

Link apache to repository

Add location directive to the https virtual host in the ssl.conf file.

<location>
  DAV svn
  SVNPath "C:/svnrepo"
</location>

Restart the Apache server and launch browser to https://www.my-site.com/svn/

Enforce security

Go to Apache's conf directory and run command below to create two user account. Note: the first command has -c option to create the password file.

..\bin\htpasswd -cm svn-auth-file user1
..\bin\htpasswd -m svn-auth-file user2

Edit the ssl.conf file to change the section we just added as below.

<location>
  DAV svn
  SVNPath "C:/svnrepo"
  AuthType Basic
  AuthName "Subversion repository"
  AuthUserFile "conf/svn-auth-file"
  Require valid-user
</location>

Final Restart

Restart the Apache server and launch the browser. We did it!

No comments:

Post a Comment