Having a .. CTAN mirror will change your life. – M Doob
You can help the TeX community by running an offical mirror of the Comprehensive TeX Archive Network. This page contains directions that should suffice if you run Linux and probably also if you run Macintosh OS X.
We have three core sites that install new packages and package updates.
We also have perhaps a hundred mirrors,
who copy our holdings every night and then make those
files available to others in the TeX community.
The core sites reduce the network load by redirecting
requests for file downloads to our mirrors.
(Our download links begin
http://mirror.ctan.org, which redirects to
an official mirror near to the user.)
If you become a mirror then once you have it set up, it mostly runs itself. So this is a low-impact way to help out. You must have a permanent IP address and at least 30 GB of hard drive space.
This is an outline of the steps (more on each is below): (1) to give visitors access to files you must run a web, or FTP, or rsync demon, or some combination of the three (2) you must get the files from us by running rsync (3) you must update those every day by runing rsync as a cron job (4) you must notify us to make you an official mirror.
Offer the files to your visitors
over HTTP, over FTP, over rsync, or over a combination.
The examples below assume
that you keep the archive in the
/var/ftp/pub/tex-archive directory.
To offer the materials over the web protocol HTTP you need a web server. We use Apache. Setting up the web server is beyond this document's scope but here are a few suggestions.
ln -s /var/ftp/pub/tex-archive /var/www/html/tex-archivemakes
http://www.example.com/tex-archive
give the page showing the top level directory for the archive.
index.html to be served by Apache as the
index of that directory's page
(it may keep people from seeing the directory tree).
Put something like this in your configuration file.
<Directory /> # prevent web visitors from seeing outside the web tree Order Deny, Allow Deny from all <Directory> <Directory /var/www/html> # allow web visitors to see in the web tree Order Allow, Deny Allow from all Options +FollowSymLinks </Directory> <Directory /var/www/html/tex-archive> # soft link to CTAN tree Order Allow, Deny Allow from all Options -ExecCGI, +FollowSymLinks, -Includes, -IncludesNOEXEC, +Indexes DirectoryIndex # no value, so 'index.html' is not used </Directory>
To offer materials over the File Transfer Protocol FTP you must have an FTP demon running. We use vsftpd but there are many others. Setting up the demon is beyond our scope, but if your documentation does not cover how to allow anonymous access then just get new server software.
To offer the materials over the file transfer protocol rsync
you must have an rsync server.
Get it from your system vendor's package system or
see its source.
We suggest that you
call the rsync module "CTAN" so
that the relevant part of your rsyncd.conf configuration file
looks like this.
read only = true exclude = .mirror .cache .zipped [CTAN] comment = Mirror of the Comprehensive TeX Archive Network path = /var/ftp/pub/tex-archive max connections = 20 lock file = /var/run/rsyncd_ctan.lock
To get the materials, run the rsync client. This program does the transfers efficently, saving both you and us a great deal of traffic.
You should mirror one of the three primary CTAN nodes. The example below uses the first but you should use the one nearest to you.
| Site | Location |
|---|---|
rsync://rsync.dante.ctan.org/CTAN | Germany |
rsync://rsync.tex.ac.uk/CTAN | England |
rsync://rsync.tug.ctan.org/CTAN | Northeast USA |
The command below will get everything on CTAN and put it on your hard drive. Use it both the first time that you get materials from the archive, and also for later updates. Note that the first time that you run it the command takes a long time — hours, perhaps, depending on your connection speed.
rsync -av --delete rsync://rsync.dante.ctan.org/CTAN /var/ftp/pub/tex-archive
Here is what the options mean:
-a gives archive mode so that you look through directories
recursively, preserve timestamps, etc.,
-v is for verbose output that reports the files downloaded
and deleted,
--delete will delete files that used to be on CTAN but are no
longer there.
Before you run the command, you can see
what would happen
by using the -n
option, as in rsync -avn --delete ...
You must run rsync every day
(we
monitor mirrors
and if
yours falls behind then we shall remove it from the official list).
At the command line ask for
crontab -e
and in the editor that appears enter a line like this.
34 1 * * * rsync -a --delete rsync://rsync.dante.ctan.org/CTAN /var/ftp/pub/tex-archive
The five entries
at the start of that line means that your system will run the
rsync command
at 34 minutes past the hour,
of the 1st hour of the day,
for every day of the month,
every month of the year,
and every day of the week (that is, Sunday thru Saturday).
Please use times that are in the middle of the night at the location that you are mirroring.
Once you have gotten the files, and the cron job is working, and you have checked that you are offering public access, then you can become an official mirror by filling out the form below.
You will be enrolled in the low-traffic mailing list for our mirror maintainers.
This document is based on a presentation by M Doob at the 2001 meeting of the TeX Users Group. Written 2001-Sep-11 by J Hefferon, updated 2010-Mar-18.