Configuring local mirror of Linux distributions

From Fireball
Revision as of 15:37, 2 June 2017 by GuFranco (talk | contribs) (Created page with "Local mirrors of many important linux distributions and packages is available on http://fireball-public.phys.wvu.edu/mirror This tutorial explains the steps to recreate this...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Local mirrors of many important linux distributions and packages is available on

http://fireball-public.phys.wvu.edu/mirror

This tutorial explains the steps to recreate this mirroring system


Installing HTTP servers

A web server is installed with as a dependency of the mediawiki package but could be installed idenpendently using:

yum install httpd

Excluding some directories

The mirror site on mirror.math.princeton.edu is far larger that we can host The file '/root/mirror.exclude' is created to exclude some directories of being copied.

/*-archive
/alt
/centos-altarch
/centos-vault
/deepin*
/fedora-secondary
/openmandriva
/osdn
/sourceforge
/trisquel*
/vim
/php
/gimp
/vlc
/apache
/ceph
/kernel
/gnome
/google*.html

# TOO BIG for MIRRORING
/opensuse-full
/fedora
/mageia
/springdale
/kali
/sabayon
/scientific
/manjaro
/xbmc


Using crontab for programming the downloads

Edit a file 'crontab' for the root user like this:

# use /bin/sh to run commands, overriding the default set by cron
SHELL=/bin/sh
# mail any output to `root'
MAILTO=root@localhost
#
13   0,6,18 * * * rsync -av --delete rsync://mirror.math.princeton.edu/pub/  /home/ftp 
--exclude-from /root/mirror.exclude > /root/mirror.log

Activate the cron calling the crontab command

crontab crontab


Activate HTTP mirror access

Create this file for configuring the mirror access:

/etc/httpd/conf.d/mirror.conf

#
# Local mirror of many linux distros and software repositories
#

Alias /mirror /home/ftp

<Location /mirror>
#Deny from all
Allow from all
Require all granted
Options All Indexes FollowSymLinks

#  Require local
#  Require ip 157.182.3.79
#  Require host fireball-public.phys.wvu.edu
</Location>