Archive for 'Linux'

Download PDF

As I write a lot of scripts for different tasks I find it useful to keep a hold of them all for future reference.
One of the easiest ways of keeping this information no matter where I am is to create my own home subversion repository. This means that no matter where I am, as long as I have http access to my home server I can get to my files.

How do you do this, well the first thing is to create your repository. Suppose I want to create a Repository at /usr/local/subversion/repository using fsfs database so execute the command:

mkdir -v /usr/local/subversion/
/usr/bin/svnadmin create --fs-type fsfs /usr/local/subversion/repository

That should create a subversion repository under /usr/local/subversion/repository.

ls /usr/local/subversion/repository
conf/ dav/ db/ format hooks/ locks/ README.txt

You should be able to see those files under the repository directory.

Setting up httpd.conf to serve the created repository:

Add the following lines to httpd.conf or the appropriate apache configuration file.

<Location /subversion>

  DAV svn

  SVNPath /usr/local/subversion/repository/

</Location>

Make sure that the module mod_dav is loaded in the apache configuration file and is also present under modules directory.

 

Setting up authentication:

For the authentication we need to make changes to the apache configuration yet another time.

Basic authentication requires that we just add the following lines to the httpd.conf where we added the svn repository earlier.

AuthType Basic

AuthName "{Name of the authentication popup tab}"

AuthUserFile {Location of the password file}

Require valid-user

So it should look like this.

<Location /subversion>

  DAV svn

  SVNPath /usr/local/subversion/repository/

  AuthType Basic

  AuthName "Subversion repository"

  AuthUserFile /usr/local/subversion/repository/conf/svn-auth-file

  Require valid-user

</Location>

It is necessary that we add users to the password file before anyone can access it, which is described in the next step.

 

Adding SVN users:

Since we are using svn with an apache server, and an apache basic authentication method.

We need to create a password file with the htpasswd binary provided with a standard apache installation.

htpasswd -cmd /usr/local/subversion/repository/conf/svn-auth-file {user-name}

-c option creates a new htpasswd file.

-m encrypts the password with an MD5 algorithm.

-d encrypts the password with a CRYPT algorithm.

Where {user-name} stands for an actual user name that will be used for authentication.

Warning: We should not use the -c option once we have added the first user. Using so will create and replace all existing user within the file.

htpasswd -md /usr/local/subversion/repository/conf/svn-auth-file {user-name}

 

Setting up the initial repository layout:

A repository mostly contains 3 standard folders.

branches

tags

trunk

For creating those standard folders in a repository, create a temporary folder anywhere you want, /tmp would be a good idea, with the following subdirectories.

mkdir -pv /tmp/subversion-layout/{branches,tags}

After we have made all the layout folders, move all the contents of your project to the trunk folder.

mv -v /usr/local/apache2/htdocs /tmp/subversion-layout/trunk

Then make an initial import of the temporary created directory.

/usr/local/subversion/bin/svn import /tmp/subversion-layout/ http://127.0.0.1/subversion/

This will setup you up with a default repository layout, and make a first revision.

Download PDF

Over the last wee while I have been running this server on the Intel Dual Core Atom D945GCLF2 board, replacing my old via EPIA 9000 motherboard.

Overall the performance and usability have been fantastic. I’ve installed Centos 5 on the board and carry out updates as they happen.

The only problem I have come across is the network driver. The board has a RealTek 8111c chip on board which is not stable with the stock kernel supplied.

The solution for this is to pull down the latest driver from the realtek web site.

At this present moment this is r8168-8.014.00, installing the driver is extremely simple using the following commands :

Unpack the tarball :
# tar vjxf r8168-8.aaa.bb.tar.bz2

Change to the directory:
# cd r8168-8.aaa.bb

If you are running the target kernel, then you should be able to do :

# make clean modules    (as root or with sudo)
# make install
# depmod -a
# modprobe r8168

You can check whether the driver is loaded by using following commands.

# lsmod | grep r8168
# ifconfig -a

The only modification I made was to the modprobe.conf file by ensuring that the alisas for eth0 pointed to the new driver.

All you need is the line

alias eth0 r8168

After that all network activity is extremely stable 🙂

« Previous posts Back to top