The company wants to start restricting all VMS directly to the extranet, so it needs to build a local source locally, before sharing a centos local source structure, and also today the Ubuntu is sorted out.
Installation of Apt-mirror Tools
# Apt-get Install Apt-mirror
Second, configure Apt-mirror
Because the source content is more, so it is best to separate a disk storage, I put in the/cache1/apt-soutce
# vim/etc/apt/mirror.list
############# Config ##################
#
Set Base_path/cache1/apt-source
#
Set Mirror_path $base _path/mirror
Set Skel_path $base _path/skel
Set Var_path $base _path/var
Set Cleanscript $var _path/clean.sh
Set Defaultarch <running host architecture>
Set Postmirror_script $var _path/postmirror.sh
Set Run_postmirror 0
Set Nthreads 40
Set _tilde 0
#
############# End Config ##############
######################################### #trusty ############################
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty-backports main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty-proposed main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty-security main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/trusty-updates main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty-backports main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty-proposed main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty-security main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/trusty-updates main restricted universe multiverse
######################################### #precise ###########################
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise-backports main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise-proposed main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise-security main restricted universe multiverse
DEB-AMD64 http://mirrors.sohu.com/ubuntu/precise-updates main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise-backports main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise-proposed main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise-security main restricted universe multiverse
deb-i386 http://mirrors.sohu.com/ubuntu/precise-updates main restricted universe multiverse
Third, configure timing synchronization
# Vim/etc/cron.d/apt-mirror
0 0 * * 0 apt-mirror/usr/bin/apt-mirror >/cache1/apt-source/var/cron.log
Four, start the synchronization
The synchronization process is either prompt or interrupted, and the next time you run Apt-mirror it will continue
# Apt-mirror
V. Build Web Services
I use the Nginx, choose according to my own preference.
Link Source to/var/www below
Cd/var/www
Ln-s/cache1/apt-source/mirror/mirrors.sohu.com/ubuntu Ubuntu
Vi. updating of local sources
The source is set to "Deb http://", the default is to sync 64-bit packets, if required 32-bit support needs to be changed to "deb-i386 http://"
# vim/etc/apt/sources.list
Deb Http://xx.xx.xx.xx/ubuntu precise main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-backports main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-proposed main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-updates main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-security main Multiverse restricted universe
Deb Http://xx.xx.xx.xx/ubuntu precise-security main Multiverse restricted universe
Update apt database information after Setup is complete
Apt-get Update