Thinking of offering a slice of your bandwidth to help spread the podcast? This page is just for you! It describes the steps needed to set up and register a mirror of the Ubuntu-UK podcast.

We assume that you have a server, Apache, and SSH set up and running - also a fast connection speed such as 100Mbps is preferable. Rsync must also be installed.

We're going to create a user and group called 'uupc' and store the mp3 and Ogg files in /srv/uupc-mirror/.

Account set up

This section sets up a uupc account for the sync user script. This script is run on release and triggers the mirror synchronization to the master rsync repository.

Tip: Should you wish to automate this process, the setup-uupc-mirror.sh script is available.

First, we require root privileges to create the account:

sudo -i

Now create a group for the podcast user:

groupadd uupc

Create the user with the appropriate flags:

useradd -c uupc -d /home/uupc/ -s /bin/sh -m -g uupc uupc

Create a .ssh directory for the user, this is where the SSH key for syncing shall be stored:

mkdir -p /home/uupc/.ssh

Download and place the SSH key in the created directory:

wget http://podcast.ubuntu-uk.org/~daviey/authorized_keys \
    -O /home/uupc/.ssh/authorized_keys

Note that the key's fingerprint is: be:3a:81:ec:ac:a9:e6:17:19:e8:3c:48:53:87:a3:4e. Please make sure you downloaded the correct key. ssh-keygen -lf /home/uupc/.ssh/authorized_keys will print the fingerprint.

Change the permissions so that the uupc user owns the new files in their home directory:

chown -R uupc:uupc /home/uupc/.ssh
chmod 700 /home/uupc/.ssh
chmod 600 /home/uupc/.ssh/authorized_keys

Now edit the "/home/uupc/.ssh/authorized_keys" with your favourite editor to point to the mirror's location on the server, this is the directory where we're storing the media files (/srv/uupc-mirror in our example here). This location is specified after the host - it's /var/www/ by default in the file you just downloaded (between 'podcast.ubuntu-uk.org::podcast' and '--exclude').

vim ~uupc/.ssh/authorized_keys

And exit the root session:


DNS configuration

Next, we have to contact podcast (at) ubuntu-uk (dot) org with details about the server, connection speed, location, IP, OS (You have installed Ubuntu on it, have you not?), and they will assign you a domain name based on your location. If the mirror is located in France, this could be fr-pa-0.static.podcast.ubuntu-uk.org for example.

Apache configuration

Now with DNS done and forgotten, we must set up Apache or another HTTP daemon that we are running, this section deals with Apache.

Create a configuration file named /etc/apache2/sites-available/uupc-mirror and enter the following configuration:

NameVirtualHost fr-pa-0.static.podcast.ubuntu-uk.org
<VirtualHost fr-pa-0.static.podcast.ubuntu-uk.org>
        ServerAdmin webmaster@localhost
        ServerName fr-pa-0.static.podcast.ubuntu-uk.org
        DocumentRoot /srv/uupc-mirror
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        <Directory /srv/uupc-mirror>
                Options +Indexes -Includes
                IndexOptions NameWidth=* SuppressDescription
                IndexIgnore index.xhtml
                DirectoryIndex None
                AllowOverride None
                Order allow,deny
                allow from all

        CustomLog /var/log/apache2/uupc-mirror-access.log combined
        ErrorLog /var/log/apache2/uupc-mirror-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        ServerSignature On

Don't forget to change the VirtualHost, NameVirtualHost and ServerName fields to the domain name you were assigned to, and also the Directory where you podcast mirror is.

Now; enable the site:

sudo a2ensite uupc-mirror

And, lo-and-behold; reload/graceful our Apache:

sudo invoke-rc.d apache2 reload

Point your browser to the new domain and you should see the Apache directory listing with a "uupc" directory there!

The End of the Guide

That's it! In a matter of time you shall start to receive hits as the automatic download mirror selector does its magic.

UKTeam/PodcastMirroring (last edited 2011-07-13 20:40:26 by popey)