by Frost

Introduction
The past few days I have been digging and diving and reading through many different tutorials about setting up SVN (or Subversion) through Apache2 on Debian based Linux Distro's. After many trials and errors and taking down my webserver a few times I finally was able to get a full on SVN Server for my main website up and running with Authentication over SSL, and here is my tale.


The Line of Thinking
I have always wanted an SVN server for my main web server but never really had the time or motivation to figure out how to do SVN through command line (SSH) and on a Debian Linux Distro. Well the past couple days I have spent countless hours working on my main Xubuntu install getting SVN figured out and working. Then porting that over to my Server which has Debian Etch installed on it. How I wanted my SVN repository setup was what made sense to me for a web server. I stuck to the basic Tree with "trunk" and "branch" but decided to omit the "tags" since it is a website I am "versioning". Here is the tree structure:

    | ___ branch
    |         ___ www
    | ___ trunk
    |         ___ www

This structure suited my needs perfectly, as I wanted my other developer (it is only me and one other person) to be able to setup a webserver locally with branch then once the code is working under branch copy it over to trunk. Anything in trunk could at anytime be copied to webroot via a shell script. So I have stressed many times to only copy / commit working projects / files to trunk. Since this makes sense in my mind, it may not in yours, so do what you feel is best, I just found that structure to work for my needs.

Preparing The Server
Whether you are going to be setting up SVN on your local server just for your self to keep track of projects or on your remote server there are some steps to take to setup the server, with the first one being making sure you have the packages installed that need to be installed. If you are using Debian, the aptitude package manager. Here are a list of packages that are needed (Note I am assuming you are working under Apache2):

subversion
libapache2-svn

So a simple command (seen below) can make sure you have these packages installed:

1
sudo apt-get install subversion libapache2-svn

Once that has been done, we need to make sure that DAV and SSL (if SSL is wanted) are enabled by doing some simple commands:

1
2
sudo a2enmod dav
sudo a2enmod ssl

If for whatever reason you need to disable a module, the opposite to a2enmod is a2dismod (dis for disable). This is much easier then manually creating the symbolic links, and I would suggest you to use it.

Now that we have our webserver prepared (sort of) to at least handle Subversion Repositories the DAV mod and SSL connections, let's get to creating the subversion repository.

Creating the Subversion Repository
The subversion creation is really straight forward. I put my repositories under /var/svn/project_name, this is just a preference, feel free to choose where you want to put the repository, just remember the location as we will need it when we get to the VHosts file later on.

Before we get to far into the subversion, I love to create a template directory structure to do for the initial import, so here is a bash script, using a similar path to the one above to setup the structure I have outlined in this script:

1
2
3
4
5
cd /var
mkdir svn
cd svn
mkdir -p template/branch/www
mkdir -p template/trunk/www

Using the directory I stated above, here are the commands I would use to create the initial repository:

1
2
3
4
5
6
cd /var/svn
mkdir project_name
svnadmin  create project_name
chown -R www-data:www-data project_name
chmod -R g+rws project_name
svn import templates/ file:///var/svn/project_name/ -m "Initial import for structure."

Those commands are pretty straight forward. We need to change the owner (chown) to be www-data so Apache can effectively create / delete items to and from the repository. We also need to change the mode (chmod) to g+rws which essentially sets that any user part of the group www-data has read / write / and to set the user / group id upon execution. Viola we should have a fully working Subversion Repository (well almost fully working).

by Frost

Introduction
Recently I had a pretty massive fiasco at work which nearly gave me a heart attack. Apparently one of the harddrives in our Network File Server decided to give out and the backups I had been doing stopped working (have not ran for a month or two) due to a Windows Patch.


As most of anyone who has been in the situation of losing important data that you thought was backed up, it is very nerve racking, especially since all the data recovery programs I have ever used never re-created the folder structure. Well your troubles are over, Recuva is an excellent file un-delete recovery program that is also free!

Recuva
Through out the day when I realized that the file server's harddrive had been erased I was doing research for free solutions to file recovery / un-deletion. In my research I tried a few different programs, which worked but not very well until I came across Piriform's Recuva program. This program seemed well developed and they offered a portable solution (meaning you can install the software onto a Jump Drive and run the recovery software from that Jump Drive. This is an ideal solution, as installing any new software onto a harddrive can put your data at risk of not being recoverable (due to over-writing). To say the least I was extremely excited about the Free Recuva Software from PiriForm and could not wait to try it.

Using Recuva
When I started the software up it had a quick recover option or a deep scan, since the deleted data that I was trying to recover was highly sensitive I opted for the deep scan. This took about 5 hours on a 250 GB (gigabyte) harddrive. I let the Recuva Program do it's thing and left the computer fully alone during this time. When I came back I was astonished to see not only did it find all the files (and then some) but it also had the full paths listed! Well before you get too excited and hit "Recover" there is a simple setting you need to know about. Inside the Recuva Options you will need to check a check box "Recover with path Name" this will do just that! It will take those paths and recover the files with that path name.

Now when using this program it is necessary to recover all the files you want to an external harddrive, so you will need a harddrive of comparable size to the data you are recovering. Not doing so, which the program may not allow, can cause data to be over-written and un-retrievable from that point on. Just be aware of that before you try to do this recovery to have that. Then just check all the files you want to recover (if you want to select all click on the first one, Hold Shift then press End then press space and it should select all files). Now you just have to wait. Since I recovered to a USB drive (that was not 2.0) it took a fair amount of time (roughly 6-7 hours). But was well worth the wait.

After the recovery I verified the files and 99% of the files were recovered succesfully and worked flawlessly. One of the other nice benefits of Recuva is that it adds _X (where X is a number) to any duplicated files (meaning the other one was previously erased / different version). This is very handy as you can enter the file and pick which version you want to keep, especially incase one is corrupted.

Ending Notes
Well I had to learn a hard lesson this day, but I was so excited there was a free File Recovery / Un-Delete program that worked great (I would put this over programs such as Recover4All, which you have to pay for anyday). I have donated to PiriForm for this program, as I always support software that has helped me. This was a massive help and I think PiriForm for making it. Hopefully you will not require Piriform's Recuva services, but if you do you now know that PiriForm Recuva is definately the software for your file recovery / restoration / un-deletion needs!

© 2012 Help Source for Coders - Get Slunked! Suffusion theme by Sayontan Sinha