Old:DLP: Installare un Mirror Debian (piccolo howto)
Vai alla navigazione
Vai alla ricerca
# apt-get update # apt-get install debmirror apache2
Mettete in /usr/local/bin uno script chiamato "debmirror.script" come il seguente (da modificare in base alle esigienze):
#! /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
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 local-mirror in /etc/apache2/sites-available:
# 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>
e poi linkatelo:
# cd /etc/apache2/sites-enabled # ln -s ../sites-available/local-mirror local-mirror # /etc/init.d/apache2 restart
Bene, ora in make-live.conf potete usare:
LIVE_MIRROR="http://localhost/debian/"
e in /etc/apt/sources.list:
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)...