223
contributi
(modifica link per inserimento prefix) |
(aggiunto warning sul prefisso per i link) |
||
Riga 1: | Riga 1: | ||
# apt-get update | |||
# apt-get install debmirror apache2 | |||
Mettete in <tt>/usr/local/bin</tt> uno script chiamato "debmirror.script" come il seguente (da modificare in base alle esigienze): | |||
<pre> | |||
#! /bin/sh | |||
# Simple debmirror update script | |||
ARCHITECTURES="i386,amd64" | |||
SECTIONS="main,contrib,non-free" | |||
DISTS="etch,sid" | |||
REMOTE_MIRROR="ftp.de.debian.org" | |||
LOCAL_PATH="/srv/mirror/ftp.de.debian.org" | |||
OPT_SOURCES="--nosource" # put this as "--source" or leave blank | |||
# to have sources included | |||
if [ $(ps ax | grep /usr/bin/debmirror | wc -l) = 1 ]; then | |||
debmirror --getcontents --progress ${OPT_SOURCES} \ | |||
-a "${ARCHITECTURES}" -s "${SECTIONS}" \ | |||
-e rsync -r :debian -h "${REMOTE_MIRROR}" \ | |||
--dist "${DISTS}" "${LOCAL_PATH}" | |||
fi | |||
</pre> | |||
Poi rendetelo eseguibile: | |||
# chmod +x /usr/local/bin/debmirror.script | |||
Il ciclo if � un brutto hack che per� permette dei facili crontab per gli aggiornamenti automatici. | |||
Dopo che il mirror � completo potreste creare 2 link: | |||
# cd /srv/mirror/ftp.de.debian.org/dists | |||
# ln -s sid unstable | |||
# ln -s etch testing | |||
Create un file chiamato <tt>local-mirror</tt> in <tt>/etc/apache2/sites-available</tt>: | |||
<pre> | |||
# This is used for local debian mirror | |||
# | |||
# Will be available as http://localhost/debian/ | |||
# | |||
Alias /debian/ /srv/mirror/ftp.de.debian.org/ | |||
<Directory /srv/mirror/ftp.de.debian.org> | |||
order deny,allow | |||
deny from all | |||
allow from 127.0.0.0/255.0.0.0 127.0.1.0/255.0.0.0 192.168.1.0/255.255.255.0 ::1/128 | |||
Options Indexes FollowSymlinks MultiViews | |||
</Directory> | |||
</pre> | |||
e poi linkatelo: | |||
# cd /etc/apache2/sites-enabled | |||
# ln -s ../sites-available/local-mirror local-mirror | |||
# /etc/init.d/apache2 restart | |||
Bene, ora in <tt>make-live.conf</tt> potete usare: | |||
LIVE_MIRROR="http://localhost/debian/" | |||
e in <tt>/etc/apt/sources.list</tt>: | |||
deb http://localhost/debian/ sid main contrib non-free | |||
o | |||
deb file:///srv/mirror/ftp.de.debian.org sid main contrib non-free | |||
Buon divertimento! (modificate lo script se non volete occupare 50 GB)... |
contributi