http://hacktor.fs.uni-bayreuth.de/apt-got/
0. Introduction
0.1 Content
0.2 Author
0.3 Latest version
1. Preamble
3. Configuring StandAloneAptGot and mod_mirror
3.1 Mirror engine part
3.2 Preparing Apache
3.3 Making the "connection"
This documentation of mod_mirror is written by
Tobias Hertkorn - <t.hertkorn@gmx.de>
© 2004
The latest version of mod_mirror and this documentation can be picked at http://hacktor.fs.uni-bayreuth.de/apt-got/
Before proceeding please be sure that you understand the workings of apt-got
compeletly. The introduction of the mod_mirror module could break
your mirroring system if you don't know exactly know, what you are doing. Fortunately
it is very easy to detect configuration errors. So don't be too scared. (Just
a bit! ;o) )
Unfortunately I do not have a lot of experience in compiling on different architectures.
All I can tell you is, that compiling by just typing make in the
root directory of the source repository worked fine for me. (I am working and
developing on Debian. ;o) What else?) If everything went smoothly you should
end up with a mod_mirror.so file. Please send me some feedback
if you did succeed in compiling it on any other architecture/operating system.
After you have successfully created the mod_mirror.so you should
copy it to the apache modules directory. For my apache that would be /usr/lib/apache/1.3/.
Now you have to tell apache to load the module on startup. This is done by the
following line (assuming you put mod_mirror.so in /usr/lib/apache/1.3/):
LoadModule mirror_module /usr/lib/apache/1.3/mod_mirror.so
Please make sure that you read and completely understood the configuration
documentation for the StandAloneAptGot. The mod_mirror needs a
fully configured and working StandAloneAptGot to make any sense.
After you have successfully created the mod_mirror.so you should
copy it to the apache modules directory. For my apache that would be /usr/lib/apache/1.3/.
Now you have to tell apache to load the module on startup. This is done by the
following line (assuming you put mod_mirror.so in /usr/lib/apache/1.3/)
in the apache configuration file (usually /etc/apache/httpd.conf):
LoadModule mirror_module /usr/lib/apache/1.3/mod_mirror.so
On a side note, the standard setting is that the mod_mirror is
turned off.
There are several way to configure the mod_mirror. I will describe the way, where apache get adapted to the settings in StandAloneAptGot.
I would advise you to create a file called apt-got.conf in the /etc/apache
directory.
To ensure that this file gets parsed by apache add following line at the end
of httpd.conf:
include /etc/apache/apt-got.conf
From now on down all changes will be done in apt-got.conf.
For every module you configured put something like the following in apt-got.conf:
<IfModule mod_mirror.c>
Alias /debian/ /mirrors/debian/
<Directory /mirrors/debian>
MirrorModule On
MirrorURL http://your.host.name:8085/debian
MirrorDirectory On
AllowOverride None
</Directory>
</IfModule>
Now I will walk you through the meanings of those directives:
IfModule assures, that these commands get only executed when
the mod_mirror is loaded.Alias makes the directory /mirrors/debian/ (that usually would
not be visible through apache) accessible through http://your.host.name/debian/
this assumes, that StandAloneAptGot stores the cached files in /mirrors/debian/
and its subdirectories. Directory tells apache that directives follow that are strictly
for the directory /mirrors/debian and all its subdirectories.MirrorModule is a boolean switch to turn on the mod_mirror
routine in that directory.MirrorURL is the start of the URL which should be sent as an
redirect to the client if mod_mirror does not find a file that
matches the request.http://your.host.name/debian/docs/readme.html
that is not yet stored locally, the mod_mirror will send a redirect with http://your.host.name:8085/debian/docs/readme.htmlMirrorDirectory is a boolean switch that tells the mod_mirror
to redirect all directory listing requests to the mirror engine. This is usually
a good idea, as a directory listing generated by apache is bound to miss all
transparently available files that are not downloaded yet.AllowOverride tells apache that everything specified in an
.htaccess in any of the subdirectories will be ignored. This
is simply a safety precaution.All you have to do is apply this example to all modules you want to make available through apache.
REMEMBER: Do not say MirrorURL http://localhost:8085/... as this would create a local redirect on the client machine! Therefore always give the full hostname.
Don't hesitate to contact me if you have any further questions.