UBUNTU: Crear mirror

  • Instalamos un contenedor de debian 9 con 1TB
  • Actualizamos el sistema: aquí
  • apt-mirror tiene los siguientes archivos y directoris de configuración
    • /etc/apt/mirror.list: archivo principal de configuración
    • /etc/cron.d/apt-mirror: archivo para crear una cron de actualización
    • /var/spool/apt-mirror/mirror: es el directorio donde se guardan las actualizaciones, nosotros lo modificamos a /opt/apt-mirror/mirror
    • /var/spool/apt-mirror/skel: directorio temporal para guardar los indices
    • /var/spool/apt-mirror/var: Es un directorio donde se guardan los logs, urls y hashes md5.
  • Instalamos dependencias
apt install curl wget apt-transport-https dirmngr
  • Instalamos los paquetes y el programa para que se convierta en mirror
apt-get install apt-mirror proftpd-basic
  • Abrimos el archivo:
nano /etc/apt/mirror.list
  • Vamos a modificar la ruta donde se guardan los archivos
# set base_path    /var/spool/apt-mirror
X
set base_path /opt/apt-mirror
  • Los otros parámetros que podemos modificar son:
    • set defaultarch amd64: que establece a la arquitectura defecto 
  • Agregamos
set postmirror_script /var/spool/apt-mirror/var/postmirror.sh
  • Ahora agregamos los diferentes repositorios que deseamos descargar
    • Agregando el código de: aquí
  • O directamente:
############# end config ##############

deb http://ftp.us.debian.org/debian unstable main contrib non-free
deb-src http://ftp.us.debian.org/debian unstable main contrib non-free


#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS WHEZZY 7.11
#------------------------------------------------------------------------------#
deb-i386 http://ftp.us.debian.org/debian wheezy main/debian-installer main contrib non-free
deb-i386 http://ftp.us.debian.org/debian wheezy-updates main/debian-installer main contrib non-free
deb-i386 http://ftp.us.debian.org/debian wheezy-backports main/debian-installer main contrib non-free
deb-i386 http://security.debian.org/debian-security wheezy/updates main contrib non-free
deb-i386 http://www.deb-multimedia.org wheezy main non-free

deb-amd64 http://ftp.us.debian.org/debian wheezy main/debian-installer main contrib non-free
deb-amd64 http://ftp.us.debian.org/debian wheezy-updates main/debian-installer main contrib non-free
deb-amd64 http://ftp.us.debian.org/debian wheezy-backports main/debian-installer main contrib non-free
deb-amd64 http://security.debian.org/debian-security wheezy/updates main contrib non-free
deb-amd64 http://www.deb-multimedia.org wheezy main non-free

deb-src http://ftp.us.debian.org/debian wheezy main contrib non-free
deb-src http://ftp.us.debian.org/debian wheezy-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian wheezy-backports main contrib non-free
deb-src http://security.debian.org/debian-security wheezy/updates main contrib non-free
deb-src http://www.deb-multimedia.org wheezy main non-free

skip-clean http://ftp.us.debian.org/debian/dists/wheezy/main/installer-amd64
skip-clean http://ftp.us.debian.org/debian/dists/wheezy/main/installer-i386
skip-clean http://ftp.us.debian.org/debian/dists/wheezy-proposed-updates/main/installer-amd64
skip-clean http://ftp.us.debian.org/debian/dists/wheezy-proposed-updates/main/installer-i386


#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS JESSIE 8.11
#------------------------------------------------------------------------------#
deb-i386 http://ftp.us.debian.org/debian jessie main/debian-installer main contrib non-free
deb-i386 http://ftp.us.debian.org/debian jessie-updates main/debian-installer main contrib non-free
deb-i386 http://ftp.us.debian.org/debian jessie-backports main/debian-installer main contrib non-free
deb-i386 http://security.debian.org/debian-security jessie/updates main contrib non-free
deb-i386 http://www.deb-multimedia.org jessie main non-free

deb-amd64 http://ftp.us.debian.org/debian jessie main/debian-installer main contrib non-free
deb-amd64 http://ftp.us.debian.org/debian jessie-updates main/debian-installer main contrib non-free
deb-amd64 http://ftp.us.debian.org/debian jessie-backports main/debian-installer main contrib non-free
deb-amd64 http://security.debian.org/debian-security jessie/updates main contrib non-free
deb-amd64 http://www.deb-multimedia.org jessie main non-free

deb-src http://ftp.us.debian.org/debian jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian jessie-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian jessie-backports main contrib non-free
deb-src http://security.debian.org/debian-security jessie/updates main contrib non-free
deb-src http://www.deb-multimedia.org jessie main non-free

skip-clean http://ftp.us.debian.org/debian/dists/jessie/main/installer-amd64
skip-clean http://ftp.us.debian.org/debian/dists/jessie/main/installer-i386
skip-clean http://ftp.us.debian.org/debian/dists/jessie-proposed-updates/main/installer-amd64
skip-clean http://ftp.us.debian.org/debian/dists/jessie-proposed-updates/main/installer-i386

#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS stretch 9.11
#------------------------------------------------------------------------------#
deb-i386 http://ftp.us.debian.org/debian stretch main/debian-installer main contrib non-free
deb-i386 http://ftp.us.debian.org/debian stretch-updates main/debian-installer main contrib non-free
deb-i386 http://ftp.us.debian.org/debian stretch-backports main/debian-installer main contrib non-free
deb-i386 http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-i386 http://www.deb-multimedia.org stretch main non-free

deb-amd64 http://ftp.us.debian.org/debian stretch main/debian-installer main contrib non-free
deb-amd64 http://ftp.us.debian.org/debian stretch-updates main/debian-installer main contrib non-free
deb-amd64 http://ftp.us.debian.org/debian stretch-backports main/debian-installer main contrib non-free
deb-amd64 http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-amd64 http://www.deb-multimedia.org stretch main non-free

deb-src http://ftp.us.debian.org/debian stretch main contrib non-free
deb-src http://ftp.us.debian.org/debian stretch-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian stretch-backports main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://www.deb-multimedia.org stretch main non-free

skip-clean http://ftp.us.debian.org/debian/dists/stretch/main/installer-amd64
skip-clean http://ftp.us.debian.org/debian/dists/stretch/main/installer-i386
skip-clean http://ftp.us.debian.org/debian/dists/stretch-proposed-updates/main/installer-amd64
skip-clean http://ftp.us.debian.org/debian/dists/stretch-proposed-updates/main/installer-i386


###############################################################################################################################################
################################## OFFICIAL UBUNTU REPOS ARTFUL 17.10 ######################################
###############################################################################################################################################


##################################################################################################
# AMD64 #
##################################################################################################
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful multiverse

deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-updates main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-updates restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-updates universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-updates multiverse


deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-backports main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-backports restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-backports universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-backports multiverse

deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-security main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-security restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-security universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-security multiverse

deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-proposed main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-proposed restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-proposed universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ artful-proposed multiverse

###### Repositorios de Seguridad
deb-amd64 http://security.ubuntu.com/ubuntu artful-security main
deb-amd64 http://security.ubuntu.com/ubuntu artful-security restricted
deb-amd64 http://security.ubuntu.com/ubuntu artful-security universe multiverse
deb-amd64 http://security.ubuntu.com/ubuntu artful-security multiverse


###### Repositorio de canonical
deb-amd64 http://archive.canonical.com/ubuntu/ artful partner



##################################################################################################
# i386 #
##################################################################################################
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful multiverse


deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-updates main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-updates restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-updates universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-updates multiverse

deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-backports main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-backports restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-backports universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-backports multiverse


deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-security main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-security restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-security universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-security multiverse


deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-proposed main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-proposed restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-proposed universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ artful-proposed multiverse

###### Repositorios de Seguridad
deb-i386 http://security.ubuntu.com/ubuntu artful-security main
deb-i386 http://security.ubuntu.com/ubuntu artful-security restricted
deb-i386 http://security.ubuntu.com/ubuntu artful-security universe multiverse
deb-i386 http://security.ubuntu.com/ubuntu artful-security multiverse


###### Repositorio de canonical
deb-i386 http://archive.canonical.com/ubuntu/ artful partner



##################################################################################################
# SRC #
##################################################################################################
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful main
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful multiverse

deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-updates main
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-updates restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-updates universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-updates multiverse

deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-backports main
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-backports restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-backports universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-backports multiverse

deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-security main
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-security restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-security universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-security multiverse

deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-proposed main
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-proposed restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-proposed universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ artful-proposed multiverse


###############################################################################################################################################
################################## OFFICIAL UBUNTU REPOS BIONIC 18.04 ######################################
###############################################################################################################################################


##################################################################################################
# AMD64 #
##################################################################################################

###### Repositorios Oficiales
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic multiverse

deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-updates main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-updates restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-updates multiverse


deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-backports main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-backports restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-backports universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-backports multiverse

deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-security main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-security restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-security universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-security multiverse

deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed main
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed restricted
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed universe
deb-amd64 http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed multiverse


###### Repositorios de Seguridad
deb-amd64 http://security.ubuntu.com/ubuntu bionic-security main
deb-amd64 http://security.ubuntu.com/ubuntu bionic-security restricted
deb-amd64 http://security.ubuntu.com/ubuntu bionic-security universe multiverse
deb-amd64 http://security.ubuntu.com/ubuntu bionic-security multiverse


###### Repositorio de canonical
deb-amd64 http://archive.canonical.com/ubuntu/ bionic partner


##################################################################################################
# i386 #
##################################################################################################

###### Repositorios Oficiales
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic multiverse


deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-updates main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-updates restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-backports main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-backports restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-backports universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-backports multiverse


deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-security main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-security restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-security universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-security multiverse


deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed main
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed restricted
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed universe
deb-i386 http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed multiverse


###### Repositorios de Seguridad
deb-i386 http://security.ubuntu.com/ubuntu bionic-security main
deb-i386 http://security.ubuntu.com/ubuntu bionic-security restricted
deb-i386 http://security.ubuntu.com/ubuntu bionic-security universe multiverse
deb-i386 http://security.ubuntu.com/ubuntu bionic-security multiverse

###### Repositorio de canonical
deb-i386 http://archive.canonical.com/ubuntu/ bionic partner


##################################################################################################
# SRC #
##################################################################################################
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic main
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic multiverse

deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-updates main
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-updates restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-backports main
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-backports restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-backports universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-backports multiverse

deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-security main
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-security restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-security universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-security multiverse

deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed main
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed restricted
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed universe
deb-src http://cr.archive.ubuntu.com/ubuntu/ bionic-proposed multiverse



###############################################################################################################################################
################################## LIMPIAR REPOSITORIOS ######################################
###############################################################################################################################################
clean http://ftp.us.debian.org/debian
clean http://security.debian.org/debian-security
clean http://www.deb-multimedia.org

clean http://cr.archive.ubuntu.com/ubuntu
clean http://security.ubuntu.com/ubuntu
clean http://archive.canonical.com/ubuntu
  • Ahora creamos la carpeta
mkdir -p /opt/apt-mirror
  • Ahora corremos el comando para descargar los repositorios
apt-mirror
  • Podemos ir viendo como descarga
df -lh /opt/apt-mirror/
  • Cuando termine de bajar los archivos podemos mandar a limpiar espacio en disco
/bin/bash /var/spool/apt-mirror/var/clean.sh
  • Ahora vamos a activar el cron para que se ejecute a las 10 pm
nano /etc/cron.daily/apt-mirror  
  • Modificamos
#0 4    * * *   apt-mirror      /usr/bin/apt-mirror > /var/spool/apt-mirror/var/cron.log
X
0 22    * * *   apt-mirror      /usr/bin/apt-mirror > /var/spool/apt-mirror/var/cron.log

Instalar servidor web

  • Instalamos apache
apt-get install apache2
  • Creamos los virtualhosts
  • Puerto 80:
nano /etc/apache2/sites-available/debian.mirror.siua.ac.cr.conf
  • CONTENIDO:
<VirtualHost *:80>

 #************************************************************************
 #******************* DATOS DEL SITIO WEB ********************************
 #************************************************************************
 ServerName debian.mirror.siua.ac.cr
 ServerAlias www.debian.mirror.siua.ac.cr
 ErrorLog /var/log/apache2/debian.mirror_80.siua.ac.cr-error.log
 CustomLog /var/log/apache2/debian.mirror_80.siua.ac.cr-access.log common

 #************************************************************************
 #********************** DATOS DEL WEBMASTER *****************************
 #************************************************************************
 ServerAdmin interuniversitariadealajuela@gmail.com
 Header add Author "Unidad de Gestion e Innovacion Tecnologica"

 #************************************************************************
 #********************* DATOS DEL REDIRECIONAMIENTO **********************
 #************************************************************************
 RedirectMatch permanent ^/(.*) https://debian.mirror.siua.ac.cr/$1


 #************************************************************************
 #************************* DATOS DEL SITIO WEB **************************
 #************************************************************************
 DocumentRoot /var/www/html/debian

</VirtualHost>
  • Puerto 443:
nano /etc/apache2/sites-available/debian.mirror.siua.ac.cr-le-ssl.conf   
  • CONTENIDO:
<IfModule mod_ssl.c>

 #************************************************************************
 #HTTPS://www.debian.mirror.siua.ac.cr
 #************************************************************************
 <VirtualHost *:443>
 ServerName www.debian.mirror.siua.ac.cr
 RedirectMatch permanent ^/(.*) https://debian.mirror.siua.ac.cr/$1
 #************************************************************************
 #*************************** DATOS DEL CERTIFICADO **********************
 #************************************************************************
 SSLEngine on
 SSLCertificateFile /etc/apache2/certificados/debian.mirror.siua.ac.cr/fullchain.pem
 SSLCertificateKeyFile /etc/apache2/certificados/debian.mirror.siua.ac.cr/privkey.pem
 </VirtualHost>

 #************************************************************************
 #HTTPS://debian.mirror.siua.ac.cr
 #************************************************************************
 <VirtualHost *:443>

 #************************************************************************
 #******************* DATOS DEL SITIO WEB ********************************
 #************************************************************************
 ServerName debian.mirror.siua.ac.cr
 ErrorLog /var/log/apache2/debian.mirror_443.siua.ac.cr-error.log
 CustomLog /var/log/apache2/debian.mirror_443.siua.ac.cr-access.log common

 #************************************************************************
 #********************** DATOS DEL WEBMASTER *****************************
 #************************************************************************
 ServerAdmin interuniversitariadealajuela@gmail.com
 Header add Author "Unidad de Gestion e Innovacion Tecnologica"


 #************************************************************************
 #************************** DATOS DEL CERTIFICADO ***********************
 #************************************************************************
 SSLEngine on
 SSLCertificateFile /etc/apache2/certificados/debian.mirror.siua.ac.cr/fullchain.pem
 SSLCertificateKeyFile /etc/apache2/certificados/debian.mirror.siua.ac.cr/privkey.pem

 #************************************************************************
 #************************** DATOS DEL SITIO WEB *************************
 #************************************************************************
 DocumentRoot /var/www/html/debian

 <Directory />
 Options Indexes FollowSymLinks Includes ExecCGI
 AllowOverride All
 Require all granted
 Allow from all
 </Directory>
 <Directory /var/www/html/debian>
 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted
 </Directory>

 </VirtualHost>
</IfModule>
  • Ahora vamos a crear una enlace simbólico para que se pueda ingresar por apache
ln -s /opt/apt-mirror/mirror/cr.archive.ubuntu.com/ubuntu /var/www/html/ubuntu
ln -s /opt/apt-mirror/mirror/security.ubuntu.com/ubuntu /var/www/html/security.ubuntu
ln -s /opt/apt-mirror/mirror/archive.canonical.com/ubuntu /var/www/html/canonical.ubuntu
ln -s /opt/apt-mirror/mirror/ftp.us.debian.org/debian /var/www/html/debian
ln -s /opt/apt-mirror/mirror/security.debian.org/debian-security /var/www/html/security.debian
ln -s /opt/apt-mirror/mirror/www.deb-multimedia.org /var/www/html/multimedia.debian
  • Con esto ya podemos ingresar a:
https://debian.mirror.siua.ac.cr
https://security.debian.mirror.siua.ac.cr
https://multimedia.debian.mirror.siua.ac.cr
https://ubuntu.mirror.siua.ac.cr
https://canonical.ubuntu.mirror.siua.ac.cr
https://security.ubuntu.mirror.siua.ac.cr

Configurar clientes Debian

  • Respaldamos el archivo
cp /etc/apt/sources.list /etc/apt/sources.list.bak.ugit
  • Abrimos el archivo
nano /etc/apt/sources.list
  • Y remplazamos el mirror
deb http://ftp.debian.org/debian stretch main contrib
deb http://ftp.debian.org/debian stretch-updates main contrib
deb http://security.debian.org stretch/updates main contrib

X

deb https://debian.mirror.siua.ac.cr stretch main contrib
deb https://debian.mirror.siua.ac.cr stretch-updates main contrib
deb https://security.debian.mirror.siua.ac.cr stretch/updates main contrib

Configurar clientes Ubuntu

  • Instalamos dependencias
apt install apt-transport-https
  • Respaldamos el archivo
cp /etc/apt/sources.list /etc/apt/sources.list.bak.ugit
  •  Abrimos el archivo:
nano /etc/apt/sources.list
  •  Remplazamos
http://cr.archive.ubuntu.com/ubuntu/
X
https://ubuntu.mirror.siua.ac.cr
---------------------------------------------------------------
http://security.ubuntu.com/ubuntu
X
http://security.ubuntu.mirror.siua.ac.cr