#MacOSX : Subversion Server


You know, Mac OS X is a UNIX system based on FreeBSD, so you can do a lot of NERD things out of the box.

This time you will learn how to setup a Subversion Server:

  1. Open Terminal app
  2. Type:
    mkdir -p /Library/Subversion/Repository
    cd /Library/Subversion/Repository
    svnadmin create myproject
  3. Great! Now that you have created the first repository, you need to configure it; type:
    vim /Library/Subversion/Repository/myproject/conf/svnserve.conf

    You’ll see ### commented lines. The lines with the single “#” comment marks are the ones we need to edit. You’ll want to remove the comments (#) and customize these settings to suit your project’s needs:

    • password-db : this specify text file that stores the usernames and passwords of authorized users for your repository. Unless otherwise specified, it will be assumed that this file is stored in your projects “conf” directory. When you create your repository a “passwd” file is created by default.
    • realm : realm tells clients what they are connecting to. It’s recommended you customize this to something like <Project Name> Subversion Repository.
    • anon-access : this directive indicates what anonymous users are allowed to do with your repository. You should set it to none.
    • auth-access : determines what permission level authorized users will have. In almost every case this will be set to write.
  4. Now you must edit password-db file; you can add as many users to your repository(s) as you want. Add at least one user for yourself so that you can begin committing to your repository:
    vim /Library/Subversion/Repository/myproject/conf/passwd
  5. Next you need to change permissions on the Repository directory so that svnserveis permitted to make changes to the files stored there:
    sudo chown -R root:admin /Library/Subversion/Repository
    sudo chmod -R ug+rwX,o= /Library/Subversion/Repository
  6. Start Subversion Server:
    svnserve -d -r /Library/Subversion/Repository
  7. Check if it works:
    cd
    mkdir project
    cd project
    svn checkout --username <user> --password <user_password> svn://localhost/myproject
  8. If it works you should have myproject directory in Repository. Well Done.

NOTE1: /Library/Subversion/Repository is just an appropriate example for Repository, but you can choose every other location.

NOTE2: in svnserve.conf and passwd files remove every white spaces at the beginning of non empty lines or it will not work.

NOTE3: if you want allow users to connect from internet you should set port forwarding on TCP port 3690 (svn default).

NOTE4: check Subversion Complete Reference for more info.

Advertisement

About whitehatty

Computer Engineer and Scientist interested in Computer Security, Complex Networks, Math, Biology and Medicine. "Think Different" life style. Quake 3 Arena player. NERD by DNA.

Posted on May 11, 2012, in Apps, Mac OS X Tips & Tricks and tagged , , , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: