old-www/HOWTO/Network-Install-HOWTO-8.html

220 lines
9.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Network Install HOWTO: Debian Server Setup</TITLE>
<LINK HREF="Network-Install-HOWTO-9.html" REL=next>
<LINK HREF="Network-Install-HOWTO-7.html" REL=previous>
<LINK HREF="Network-Install-HOWTO.html#toc8" REL=contents>
</HEAD>
<BODY>
<A HREF="Network-Install-HOWTO-9.html">Next</A>
<A HREF="Network-Install-HOWTO-7.html">Previous</A>
<A HREF="Network-Install-HOWTO.html#toc8">Contents</A>
<HR>
<H2><A NAME="s8">8. Debian Server Setup</A></H2>
<P>
<!--
network install!debian server setup
-->
This section explains how to set up your server machine to be an install server
for Debian. You can set up any Linux distribution to be a Debian install
server, this machine does not necessarily have to be running Debian. Don't
forget that there are already plenty of Debian mirrors out there that provide
free access to the Debian archive so unless you really need your own archive it
might be best just to use one that already exists.
<P>This guide starts from the point where you have a machine installed with Linux
which is already up and running and connected to your network. If you require
help with installing Linux on your server then please consult the Further
Information section of this HOWTO in
<A HREF="Network-Install-HOWTO-10.html#AppendixA">Appendix A</A>.
<P>
<P>
<H2><A NAME="ss8.1">8.1 Setting Up Filespace</A>
</H2>
<P>In order for your server to act as a Debian network install server you will need
to set up your machine to be a mirror of the Debian archives. Unlike most Linux
distributions, Debian is commonly installed over the network, so you are not
likely to have obtained a set of CD images containing Debian. A mirror system
is provided that enables you to copy all the required data to your own server
machine, for free.
<P>Before you even think about setting up your machine as an install server, you
must check that you have the required space available. This sounds like a
trivial thing to check but it is very important and easily forgotten when you're
setting up.
<P>
<P>
<H3>How much space will you need?</H3>
<P>The entire Debian archives are roughly around 40Gb at the time of writing but if
you are going to set up a full mirror then bear in mind that this will grow. It
is possible for you to mirror only parts of the Debian archive and you can
obviously mirror just the parts that you think you will require. For example,
if you do not use a certain machine architecture then there may be little point
in your mirroring this part of the archive.
<P>The latest information about the size of the Debian archive is available from
their website at
<A HREF="http://www.debian.org/mirror/size">http://www.debian.org/mirror/size</A>.
<P>
<P>
<H3>How much space do you have?</H3>
<P>You will need the appropriate amount of space available to your system on some
local filesystem. It does not matter what form this takes, whether it's a RAID
device, local disk (either SCSI or IDE), etc. Ensure that the space you intend
to use is formatted with your chosen filesystem and is mounted.
<P>You can check this space with the command:
<PRE>
df -h
</PRE>
<P>If this output shows you have enough space then great, you can continue.
If not then it's time to think about an upgrade to your intended server machine!
<P>
<P>
<H2><A NAME="ss8.2">8.2 Mirror the Debian Archive</A>
</H2>
<P>When you are confident that you have enough space for the data you want to
mirror then you can move on to this step. If you are not sure you have enough
space to mirror all the parts of the Debian archive that you want then you can
always try this method, then if you run out of space, remove some parts of the
archive from the mirror and try again.
<P>Debian maintain their own guide on how to set up your own Debian mirror. You
are welcome to view this at
<A HREF="http://www.debian.org/mirror/ftpmirror">http://www.debian.org/mirror/ftpmirror</A>.
The list of steps below is based on the Debian instructions but is my own
interpretation of them, designed to be easy to use and understand.
<P>
<P>
<H3>Where to Mirror From?</H3>
<P>There are an awful lot of Debian sites out there that you could mirror from. It
is best for you to choose one that is near your location or one that you know
will have a good bandwidth to your location. Please remember, that if everybody
uses the same sites for their own mirrors then things will get rather slow, so
choose carefully.
<P>A list of sites that you can choose to mirror from can be found
at
<A HREF="http://www.debian.org/misc/README.mirrors">http://www.debian.org/misc/README.mirrors</A><P>
<P>
<H3>How to Mirror?</H3>
<P>I would recommend using a program called <CODE>rsync</CODE> to copy the data from
your chosen server to your own server. This is a program that is ideally suited
to mirroring data from one system to another. If you want to find out more
information about <CODE>rsync</CODE> itself then see the webpages or the man pages
for it.
<P>Debian provide a well commented script
at
<A HREF="http://www.debian.org/mirror/anonftpsync">http://www.debian.org/mirror/anonftpsync</A> that
will perform the mirroring for you. Go to this site and download the
script to your server machine, we will then need to set up the script to mirror
the archive as you want it.
<P>Now go through the entire script (it's not very long) and look at each line.
Decide whether you want the line to be active in your script or not. If you
don't know what a line does then it is probably best to leave it at it's
default setting. However, you <EM>must</EM> set up the script with some
minimal settings in order for it to work at all. These will include your chosen
server, the location to put the archive on your machine, etc.
<P>Once you have set up the script with all the required information requested in
it then you are ready to run it and it will start copying data from the server
you have chosen to your own server machine. Don't forget to change the
permissions of the script so that it is executable and then run it from the
command line.
<P>The Debian archive is regularly updated and in order to maintain your own
archive and make sure it is up to date, you will need to periodically run the
script again to copy any changes made. <EM>NOTE: the script uses rsync which
is a one-way transaction, you can never copy from your machine to your chosen
server (as you don't have permission to do so!)</EM>. It is probably best to
run the script daily, so you can edit your crontab to do this or put the script
in <CODE>/etc/cron.d/cron.daily</CODE> if your Linux distribution has this set up.
<P>
<P>
<H2><A NAME="ss8.3">8.3 Enable Remote Access</A>
</H2>
<P>Time to make your install data available to other machines on the network.
Debian can be installed using NFS, HTTP and FTP protocols. You can select which
of these will be used at install time on the client. If one of the services is
not setup on the machine then it will still be available for selection by the
client but the install will not work. Therefore, it is either best to enable
all three services on your server (so they all work on each client machine) or
if you don't enable all three then advertise the fact very well and say which
service should be used for your particular install server.
<P>
<P>
<H3>NFS</H3>
<P>To install over NFS you need to meet certain conditions on the server:
<UL>
<LI>Your install directory is exported</LI>
<LI>NFS is installed and running</LI>
<LI>Portmap is running</LI>
</UL>
<P>To export your install directory edit the <CODE>/etc/exports</CODE> file and add an
entry for directory you have copied your Debian archive to. In our examples
throughout this HOWTO, we would use the folowing line:
<PRE>
/install *(ro)
</PRE>
When you have saved your exports file you must then get your NFS daemon to read
its configuration file again in order to export the directory you just added.
Do this by running the command:
<PRE>
exportfs -r
</PRE>
This gives us the most simple read-only export to all hosts on our network. If
you want to include more advanced options in your export e.g. only exporting to
certain hosts on the network or a certain subnet, etc then see your man page for
the exports file at exports (5).
<P>
<P>
<H3>FTP</H3>
<P>To install over FTP you need to allow FTP access to the directory that you have
setup on the server as the installation directory. This can be either anonymous
FTP access or access through a named account with a password. Anonymous access
is probably best unless you have a reason to protect your install server via
a password.
<P>If you want anonymous FTP to point to a different directory then you can use
sym links to point to the directory that you have set up as the install
directory on the server. This will allow FTP into a chrooted environment but
still give you access to the install images in a different location.
<P>
<P>
<H3>HTTP</H3>
<P>If you have a web server running and want to enable HTTP access to your install
server then add sym links from your document root to the install server
directory and this will grant access. If you are not familiar with web servers
or are not comfortable with this approach then leave out HTTP access from your
install server as it provides no benefits over NFS or FTP installs which may
be simpler to set up.
<P>If you do choose to use HTTP then basically all you have to do is make the
install directory visible to your web server by making it appear under the
document root by some means. If you are using the Apache webserver then Debian
recommend adding the following to your http.conf file
<PRE>
&lt;directory /org/ftp.debian.org/ftp&gt;
IndexOptions NameWidth=* +SuppressDescription
DirectoryIndex .
&lt;/directory&gt;
</PRE>
<P>
<P>You have now completed the basic setup of your install server.
<P>
<P>
<P>
<P>
<HR>
<A HREF="Network-Install-HOWTO-9.html">Next</A>
<A HREF="Network-Install-HOWTO-7.html">Previous</A>
<A HREF="Network-Install-HOWTO.html#toc8">Contents</A>
</BODY>
</HTML>