Repository Moved thanks to Apache and 301 Redirections

Since the creation of my personal Mandriva repository (10 months ago) the number of my RPMs did not cease to increase. Currently all RPMs and SRPMs from 2006.0 and 2007.0 take 383MiB of space.

So I decided to move the http://kev.coolcavemen.com/static/repository folder to http://kevin.deldycke.free.fr/repository, which is a 10GiB (yes, ten gibibyte, this is not a typo) free web space offered by Free, my ISP.

To do this smoothly, I’ve just set up a generic 301 redirection thanks to Apache. This is the only line I added to my root .htaccess file to enable this:

Redirect permanent /static/repository http://kevin.deldycke.free.fr/repository

This move will normally be completely silent for you. So please, let me now if something bad happend while you play with my repository.

Quick How-To: Install NFS Server & Client

nfs.png

In this tiny how-to I’ll explain you how to setup a machine as a NFS server and an other one as a client. This example was written based on my experiences on Mandriva, but all commands should almost be the same for other distributions.

First, on the server, install nfs-utils:

urpmi nfs-utils

The nfs-utils package provide a daemon for the kernel NFS server and related tools. It is a much higher level of performance than the traditional Linux NFS server used by most users.

Then edit the /etc/exports file to add the list of the local folders you wqnt to share:

[root@localhost ~]# cat /etc/exports
/mnt/hdd *(rw,insecure,all_squash)

Then, to apply change, restart the NFS server:

/etc/init.d/nfs restart

In this example I simply wanted to share the /mnt/big-disk directory and all its sub-folders with anybody, with read and write access. I did this because the server was in a closed LAN, with only one client, that’s why no security, authentification or credentials to manage.

By the way, on the server, the only required services to activate at startup are the following:

  • nfs
  • nfslock
  • portmap

On client side, you also need to install nfs-utils, in order to benefit nfslock:

urpmi nfs-utils

The latter is absolutely not required, but if it’s a good idea to have it on the client side.

Then to auto-mount the distant shared folder, add the following line to your /etc/fstab file:

192.168.1.22:/mnt/hdd /mnt/distant-hdd nfs user,noatime,rsize=8192,wsize=8192,soft 0 0

Important parameters of the line above are:

  • 192.168.1.22 = IP adress of the NFS server,
  • /mnt/hdd = path of the shared folder on the server,
  • /mnt/distant-hdd = local folder where the shared folder will be mounted.

Then, you have to modify services on the client to change their default activation state.

Following services must be started at boot:

  • nfslock
  • netfs
  • rpcidmapd

Services that must should be inactivated at boot:

  • portmap
  • nfs
  • rpcsvcgssd