Wednesday, August 29, 2007

Subversion

I recently set up a subversion server for my institution. I had set one up a long time ago, but this is a different server. So had to revisit some stuff. So I guess I should document some of the stuff in case I forget them again.

So first of all, I have to create the repository. In my case, I put it in /svn/repository and I create my repository there.

# svnadmin create bankapps initenv


Settings for SUBVERSION in httpd.conf

1: <Location /svn/bankapp > -->the parameters you put in your url
2: DAV svn
3: SVNPath /svn/repository/bankapp -->the actual path to your repository
4: AuthzSVNAccessFile /svn/users/users -->the path to your user access list
5: Require valid-user
6: AuthType Basic
7: AuthName "Bank Applications Development"
8: AuthUserFile /etc/svn-auth-file -->the path to your password file
9:
</Location >


Lines 2 and 3 are the required lines for this to work, you may omit the rest if you want to allow public access.

In the user access list, you have to create a file, and in the file, it should look something like this:

[bankapps:/]

maggie = rw
user1 = rw

[/]
maggie = rw

And, for your password file, you also need to create it, using htpasswd:
# htpasswd -c passfile user

You will then be prompted to create a password. Subsequently, you may add more users:
# htpasswd -b passfile user password

Then you have to restart your apache
# ./httpd -k restart

Now, browsing to http://yourdomain.com/svn/bankapp should prompt you a password and allow you to browse the files inside.

To upload and do stuff, get the tortoisesvn, it's rather userfriendly! http://tortoisesvn.tigris.org/


No comments: