[vox-tech] HOWTO: Make Your Our Debian Mirror
Stephen M. Helms
vox-tech@lists.lugod.org
Fri, 28 Feb 2003 12:52:48 +0100
Hello Mike,
I have made some minor changes. Changed lines have a * in front and remo=
ved=20
the lines that do not need any change to save space/length of the email b=
ack=20
to you.
Stephen
On Friday 28 February 2003 02:54 am, Mike Simons wrote:
> Thu Feb 27 13:25:40 PST 2003 version 0.1
>
> This is a quick and dirty setup your own Debian Mirror Howto.
> I've been asked how to set one up several times but I've finally been
> asked by someone persistent enough to keep asking, you can thank them
> for this document :).
> I have not looked at the debian version of the debmirror script in
> ages. Ways my version was better than the packaged version include:
> =3D=3D=3D=3D
> - Does not download a file unless it actually changed
> (based on file size and timestamp check of remote to local)
> - Auto-resumes a file transfer if the transfer was aborted part way
> through.
> - Don't change the local archive's Packages files until *AFTER* all
> the files mentioned inside have been downloaded successfully
> (this was you can use the mirror while it is syncing up, or after
* (this way you can use the mirror while it is syncing up, or after
> a failed sync attempt).
> 3 - Setup a web server to serve your mirror:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> If you don't already have a apache installed...
> =3D=3D=3D
> apt-get -y install apache
> =3D=3D=3D
>
> Add the following to /etc/apache/httpd.conf:
> =3D=3D=3D
> # Allow access to Debian mirror tree...
> Alias /debian/ /home/debian/mirror/
> <Location /debian>
> Options Indexes FollowSymLinks MultiViews
> </Location>
> =3D=3D=3D
>
> Restart apache after the config change:
> =3D=3D=3D
> /etc/init.d/apache restart
> =3D=3D=3D
*or if you want apache 2.0 setup instead
* If you don't already have a apache2 installed...
* =3D=3D=3D
* apt-get -y install apache2
* =3D=3D=3D
*
* Add the following to /etc/apache2/httpd.conf:
* =3D=3D=3D
* # Allow access to Debian mirror tree...
* Alias /debian/ /home/debian/mirror/
* <Location /debian>
* Options Indexes FollowSymLinks MultiViews
* </Location>
* =3D=3D=3D
*
* Restart apache2 after the config change:
* =3D=3D=3D
* /etc/init.d/apache2 restart
* =3D=3D=3D
> 5 - Setup a dhcp server to allocated IP addresses:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
>
> If you don't already have a DHCP server on the network you will be
> installing over you should.
>
> If you already have a DHCP server do not do the following steps.
>
> Install the DHCP server
> =3D=3D=3D
> apt-get -y install dhcp
> =3D=3D=3D
>
> Put the following in /etc/dhcpd.conf
*for dhcp3
* apt-get -y install dhcp3-server
* =3D=3D=3D
*
* Put the following in /etc/dhcp3/dhcpd.conf
> =3D=3D=3D
> option domain-name-servers 192.168.123.1;
>
> option subnet-mask 255.255.255.0;
> default-lease-time 600;
> max-lease-time 7200;
>
> subnet 192.168.123.0 netmask 255.255.255.0 {
> range 192.168.123.16 192.168.123.254;
> option broadcast-address 192.168.123.255;
> option routers 192.168.123.1;
> }
> =3D=3D=3D
>
> Restart dhcp after the config change:
> =3D=3D=3D
> /etc/init.d/dhcp restart
> =3D=3D=3D
* Restart dhcp3 after the config change:
* =3D=3D=3D
* /etc/init.d/dhcp3-server restart
* =3D=3D=3D
>
> note if you don't run a DNS server on your machine you will need to
> change the domain-name-servers line to be a coma separated list of
> correct servers.
>
> note if your mirror machine is not also the gateway you will need to
> change the 'option routers'.
>
> The configuration above leaves some room (1-15) for static manually
> configured IP addresses.
>
> I will not cover setting up DNS or setting up your machine to be a
> masquerading firewall/gateway in this howto... but those are what the
> demo box does at the installfests.
> I would suggest if you get the DNS server setup you may want to
> fake advertise your mirror as 'http.us.debian.org' so that you
> don't need to do the following steps.
>
>
> 6 - Store a local sources.list file:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> On the mirror I keep a sources.list file prepared so that at install
> time when questions about what apt sources you want to use are asked
> one is handy.
>
> =3D=3D=3D
> cd /var/www
> wget http://simons-clan.com/~msimons/debian/mirror/sources.list
> chown debian:debain sources.list
* > chown debian:debian sources.list
So far so good. I will be doing the update tonight since I am on dial-up=
=20
right now and do not want to tie up my phone line. If I have any other=20
updates, I will let you know.
Again, thanks for the help and how-to. I already had installed apache 2.=
0 and=20
dhcpd3 so that is why I added those options.
Stephen