Subversion Server
Subversion Server
Configuring a Secure Subversion Server
Configuring a secure subversion server on Tiger was tricky and involved. On Leopard, it’s a snap.
Thursday, November 8, 2007
What is Subversion?
Think of it as CVS done over and done right.
Subversion is a free/open-source version control system. That is, Subversion manages files and directories, and the changes made to them, over time. This allows you to recover older versions of your data, or examine the history of how your data changed. In this regard, many people think of a version control system as a sort of “time machine”.
Subversion can operate across networks, which allows it to be used by people on different computers. At some level, the ability for various people to modify and manage the same set of data from their respective locations fosters collaboration.
Install Subversion
Nope, there’s no step 1.
Leopard server and client come pre-loaded with subversion, version 1.4.4 (r25188), so there’s no need to download, compile, and install anything (as was required with Tiger) in order to create, maintain and use your own svn repository.
Create an SVN Repository
It’s likely there are graphical tools out there for accomplishing something similar, but these command-line steps can be used to create an svn repository within the PATH /Library/Subversion/Repository.
Execute the following commands as an administrative user (i.e. with sudo privileges). The “mkdir” command creates the directory for all svn repositories. A repository within /Library seems like the OS X thing to do.
The “svnadmin create” command creates a new, empty repository. “TestProject” is an example. Once the repository is created, change the ownership of all of the files to “www” since the web server will be performing all future writes to the repository through WebDAV once we’re finished. Change the group ownership to “admin”, so other administrative users can manipulate these files, if they need to. Finally change the permissions to “770” so that “www” and “admin” get read, write, execute access but “everyone” else gets no access.
Create a standard project directory structure with “branches”, “releases”, and “trunk” subdirectories, then import the project into the svn repository with the “svn import” command and finally update ownership and permissions again.
Eanble DAV svn apache module
Enable the DAV svn apache module using the Server Admin application and “Save”.
Create a new virtual domain
Click the “+” button to create a new web site, fill in the fields, and select the “Enabled” check box.
Enable WebDav
Select the “WebDAV” checkbox within the “Options” tab.
Enable SSL over HTTP
Select the “Enable SSL” checkbox within the “Security” tab.
Create a subversion Realm
The next four screen shots show how to create a new Realm giving WebDAV read, write access to an individual user authenticated by Open Directory. Add additional users or groups of users to taste.
Modify the httpd conf file
I’m not crazy about this step, since it involves modifying a httpd configuration file managed by Server Admin, but I have yet to think of a better way to do it. Using a text editor (e.g. vi), insert the two high-lighted lines of text into the appropriate place (near the bottom) of /etc/apache2/sites/0001_any_443_secure.conf file.
Restart the Web server
“Stop Web” and “Start Web” using the Server Admin application.
Access the secure subversion server
If all is well, you should be able to access the secure subversion server, requiring a username and password for authentication.
Next Time
Next time I’ll show you how to use this secure subversion server from within Xcode to manage the version control of a software project.