How to configure Subversion in OpenSolaris
Recenly I am always thinking about how to manage personal programs, to save codes, to track changes, and to ensure their safety. I combine two things together and get a solution for my requirement, that is to use ZFS as persistent storage and use Subversion as a versioning controller, to ensure my codes can be safely saved and well managed. So today I will talk something about how to configure subversion in OpenSolaris.
Firstly, let us install amp-dev development environment. This is a open source component for SAMP development, and it contains Apache2, MySQL, PHP and Subversion (also its version is a little bit old, 1.4). Just type this following snippet:
$ pfexec pkg install amp-dev
And then you will get that package.
Then let us initialize our web stack, just run it from your X windows like that:

After activate it, we can use Apache2.
Now let create our repository for subversion. Please select a directory to store source code, and we assume that directory is “/svn”. So we mkdir it and use that command to create repository:
# svnadmin create /svn
# chmod –R 777 /svn
Then we should configure subversion and let it work properly. We may ask Apache load 2 modules of subversion:
# cd /etc/apache2/2.2/conf.d
# vi modules-32.load
add:
LoadModule dav_svn_module libexec/mod_dav_svn.so
LoadModule authz_svn_module libexec/mod_authz_svn.so
To the end of the file.
then cd .. and edit httpd.conf, add this contents to the end:
<Location /svn>
DAV svn
SVNPath /svn/
AuthType Basic
AuthName “Subversion Repository“
AuthUserFile /svn/authfile
Require valid-user
</Location>
Please note /svn in <Location /svn> is the sub domain of your http address, and you may visit this repository by “http://xxxxxx/svn/”.
And also you may find a authuserfile in httpd.conf above, and this is our authentication. We can build our user/pass by:
# htpasswd –c /svn/authfile paul
And paul is my username used in this repository. After that command, you should input your password twice. And this command is for the first time to build your authentication file. If you want add more users, just erase “-c” parameter and go on, because “-c” is stand for creating a new file and delete original authentications.
Then you can start your Apache server for a test:
# svcadm disable apache22
# svcadm enable apache22
# svcs | grep apache
online 21:48:22 svc:/network/http:apache22
If it is online, it proves work well.
Then you can use Tortoise or other svn client tools to manipulate your codes.
Enjoy Coding! Have fun!

Referrence:
- http://seanmcgrath.wordpress.com/2009/11/10/apacewebdav-for-subversion-on-opensolaris/
- http://www.blogjava.net/hadeslee/archive/2008/03/12/185788.html
- http://developers.sun.com.cn/solaris/webstack.html
- http://beluga.javaeye.com/blog/25545
- http://www.ibm.com/developerworks/cn/java/j-lo-apache-subversion/
Recent Comments