Webreakstuff blog

Setting up Subversion on OSX

Here’s a quick guide on setting up a webdav-powered “Subversion”:http://subversion.tigris.org server on Osx using darwinports. Why darwinports, you may ask? Personally, I prefer to organize all the software that lies beneath the aqua layer on Osx in a separate location (as darwinports does on the /opt/local directory), and because it makes the whole process much easier when setting up a development environment.

* Install darwinports using “their instructions”:http://darwinports.opendarwin.org/docs/ch01s03.html#install_dports
* On your terminal window, enter: sudo port install subversion +mod_dav_svn +python (if you don’t need python bindings remove the +python – if you’re not considering running “Trac”:http://projects.edgewall.com/trac/)

If you have a fresh darwinports installation, you didn’t have apache2 properly configured, so you need to run these two commands to setup a vanilla configuration file for apache that you’ll be editing later:

* cd /opt/local/apache2/conf/
* cp httpd-std.conf httpd.conf

Now that you have working subversion and apache2 installations, its time to glue them together and create your repository:

* Run svadmin create /path_to_your_new_repository
* Add “LoadModule dav_svn_module modules/mod_dav_svn.so” to your httpd.conf
* Add a new location to the apache configuration:


allow from all
DAV svn
SVNPath /path_to_your_repository
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /path_to_your_repository/passwd
Require valid-user

* Generate a new user to access your repository through the web: htpasswd -c /rep_path/passwd
* Start your apache2 server: /opt/local/apache2/bin/apachectl start and you’re done!
* Load http://localhost/svn/ on your browser to see the repository

Hope that clears some questions as to how to setup subversion on OSX using darwinports. Back to coding you go!