How to configure Subversion in OpenSolaris

Recenly I am always thin­king about how to manage per­so­nal pro­g­rams, to save codes, to track chan­ges, and to ensure their safety. I combine two things toge­ther and get a solu­tion for my requi­re­ment, that is to use ZFS as per­si­stent sto­rage and use Subver­sion as a ver­sio­ning con­t­ro­ller, to ensure my codes can be safely saved and well mana­ged. So today I will talk some­thing about how to con­fi­gure subver­sion in OpenSolaris.

 Fir­stly, let us install amp-dev deve­lo­pment envi­ron­ment. This is a open sou­rce compo­nent for SAMP deve­lo­pment, and it con­tains Apache2, MySQL, PHP and Subver­sion (also its ver­sion is a little bit old, 1.4). Just type this follo­wing snippet:

$ pfe­xec pkg install amp-dev

And then you will get that package.

image 

Then let us ini­tia­lize our web stack, just run it from your X win­dows like that:

opensola

After activate it, we can use Apache2.

Now let create our repo­si­tory for subver­sion. Please select a dire­ctory to store sou­rce code, and we assume that dire­ctory is “/svn”. So we mkdir it and use that command to create repository:

# svna­dmin create /svn
# chmod –R 777 /svn

Then we should con­fi­gure subver­sion and let it work pro­perly. We may ask Apa­che load 2 modu­les of subversion:

# cd /etc/apache2/2.2/conf.d
# vi modules-32.load

add:

Loa­dMo­dule dav_svn_module libexec/mod_dav_svn.so
Loa­dMo­dule authz_svn_module libexec/mod_authz_svn.so
To the end of the file.

then cd .. and edit httpd.conf, add this con­tents to the end:

<Loca­tion /svn>
DAV svn
SVN­Path /svn/
AuthType Basic
Auth­Name “Subver­sion Repo­si­tory“
AuthU­ser­File /svn/authfile
Require valid-user
</Location>

Please note /svn in <Loca­tion /svn> is the sub domain of your http add­ress, and you may visit this repo­si­tory by “http://xxxxxx/svn/”.

And also you may find a authu­ser­file in httpd.conf above, and this is our authen­ti­ca­tion. We can build our user/pass by:

# htpa­sswd –c /svn/authfile paul

And paul is my user­name used in this repo­si­tory. After that command, you should input your password twice. And this command is for the first time to build your authen­ti­ca­tion file. If you want add more users, just erase “-c” para­me­ter and go on, because “-c” is stand for crea­ting a new file and delete ori­gi­nal authentications.

Then you can start your Apa­che server for a test:

# svcadm disa­ble apache22
# svcadm ena­ble apache22
# svcs | grep apa­che
online         21:48:22 svc:/network/http:apache22

If it is online, it proves work well.

Then you can use Tor­toise or other svn client tools to mani­pu­late your codes.

Enjoy Coding! Have fun!

image

Refer­rence:

No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>