Thursday, January 22, 2009

How to setup a svnserve server on Ubuntu

During the past weekend, I was looking into some fun SVN solutions and the task require me to setup a SVN server on my Ubuntu box. I decided to write a little howto so if anyone is running into the same problem, hopefully this howto will solve the problem.

While I was doing my research, I found out a lot of the tutorial, even the one on Ubuntu site is hooking up svn with Apache Server. What if you are not running Apache, and what if you just want a SVN server alone? Your solution is to use svnserve alone instead.

First thing first, download subversion and subversion-tools once you have it in place choose a place where you want your repository be. For myself, I choose to have the svn repository under home folder.

Before you actually creating the directory for your repository

Choose System > Administration > Users and Groups from your Ubuntu menu.
- Select the Group tab
- Click the 'Add Group' button
- Name the group 'subversion'
- Add yourself and as users to this group

After adding yourself to the group, you can then create your svn repository
$ sudo mkdir /home/svn
$ cd /home/svn
$ sudo mkdir svn-repo
$ sudo chown -R :subversion repo
$ sudo chmod -R ug+rw repo

The above code will create a folder name repository under /home/svn/ and the owner should be yourself and the permission settings are set to 755.

Now you have the folder and permission set, you can then use svnadmin create command to add your repository. (If you already have a full functional repository at this point, you can simply skip this step)

Now you will have an initial repository, however how can you start the SVN server and may be have it start up as a service ?

The only problem I ran into is the initial install of svnserve does not has a startup scrip under the /etc/init.d/

Thanks to the community, I was able to find a script here once you download it and you will be able to use it as the init.d script. This script will allow you to start, stop and restart the SVN server (I call mine svnserve).

Once you save this script under the /etc/init.d/ directory then make sure you change the owner and group to root and set the permissions to 755 and make this script executable

sudo chmod +x svnserve


Then add the script to the boot sequence

sudo update-rc.d svnserve defaults

You are all set, enjoy !

Wednesday, January 21, 2009

How to Backup your SVN repository

SVN for sure is a great tool to keep the version controls of your code development, however what happen if the SVN server host was down due to power failure and other technical issues? Also some users may want to keep a backup copy just in case anything happen to their SVN server, so what is the best way to back up your SVN repository?

You can use the command svnadmin dump - This command will dump out the repository information that is human and machine readable. After that you can issue svnadmin load to load the information back to the svn repository.

However my choice is to use svnadmin hotcopy command. The reason I prefer this command more is because you can backup then entire repository together with your config files and this repository is fully functional, which means if you need to migrate it to another machine, simply alter the repository path and you are done, simple, easy and painless.

svnadmin hotcopy CURRENT_REPOS_PATH NEW_REPOS_PATH

Wednesday, January 14, 2009

Install Windows 7 Beta in VirtualBox

Most of you may be aware of that the new Windows 7 Beta is out and I decided to give a try and install in as a VM.

The VM client I choose to use in here is VirtualBox 2.1, if you are using VMware or other VM clients, the following steps may be helpful for you, but they may be vary depends on your VM client.

So lets get it started.
First you should head to the official donwload site (here), scroll to the very bottom you should see 2 drop downs, select 32bits version (unless you decided to put on more then 3G of Ram on your VM, then go for 64bits, if you choose 64bits the OS selection in Virtualbox will be different from what is listed below), the site will then provided you a serial key and you can download the iso.

I had some problem to download this ISO using Firefox, using IE7 is recommand in here, it will prompt you for a download manager installation, accept it and you should be fine.

Once you have the ISO downloaded, simply create a VM in VirtualBox and choose Windows as your OS type, under version, choose Other Windows.



By default Other Windows only support 32bits thus if you downloaded a 64bits iso, you can try to play around with the versions in here and use a 64bits Windows version instead of Other Wi ndows.

Next assign the memories and create a vdi for your VM and you are set.

Now go to your newly created VM settings, mount the ISO you just downloaded, and Start the VM.

Follow the on screen instructions and start the installation, now you can go out for a smoke or coffee and let the installer run :)


Depends on your installation type, you can choose upgrade (from previous version and save your settings) or you can choose Custom for a new install.


There is a fun thing I discover about Windows 7, which it seems to be allowing user to slip stream drivers unfortunately, i was not able to test it, but if such functionality exist, it will be such a great features !



Personally, I found that the new Windows installer is a lot easier and quicker compare to XP and less settings involved, which make the installation easier and smoother.

Once the installation finished, it then prompt you for the initial user info, fill in the info and set up your username and password. Guess what you are DONE!!

Well not quite, you probably would like to install the VirtualBox Guest Additions, so you can have your mouse in-and-out the Windows7 guest easily.

First I will suggest to restart the Windows 7 guest so everything is fresh, from the top (VirtualBox) menu, (unmount the Windows7 CD) and choose install guest additions

It will then prompt you to run the auto run program or open the CD folder, choose open folder.
Right Click "VBoxWindowsAdditions" and choose properties.



Choose the compatibility tab and check the box say Run this program in compatibility mode for and choose Windows Vista


Next run the VBoxAdditions as an admin by right clicking the VBoxAdditinos and say YES and allow VBoxAdditions to run. Follow the instructions and you will be able to install it.


If you do not set the VBoxAdditions to run as admin nor set the compatibility as Vista, the program will boot you and said it's a not supported version of Windows.

After the installation you will promopt for reboot, choose you will reboot later on and manual shut down the VM.

There is one extra setp you can set up so all your audio and network card drivers are set.
After your VM is shut down, go to the VM settings and enable the audio + pick your network card adpator. Under the CD-Rom, unmount the VBoxAdditions CD and mount the Windows 7 set up ISO and start up your VM again. Now everything should set up nicely and you are ready to rock and roll!