http://yangzb.iteye.com/blog/615458

http://forum.ubuntu.org.cn/viewtopic.php?t=253103

http://blog.csdn.net/zkdemon/article/details/8003734

http://nginx.org/en/docs/http/ngx_http_autoindex_module.html



为方便内网安装ubuntu软件,决定搭建一个 apt-mirror 服务器,记录下:


apt-mirror从sources.list中指定的源下载deb等文件到本地服务器,首先安装 apt-mirror

apt-get install apt-mirror 


安装完成后,编译配置文件 /etc/apt/mirror.list

############# config ##################
#
set base_path    /var/spool/apt-mirror
#
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     20
set _tilde 0
#
############# end config ##############

deb http://archive.ubuntu.com/ubuntu lucid main
clean http://archive.ubuntu.com/ubuntu


由于下载过程可能比较长,启动screen

screen

apt-mirror

Ctrl + a  d


apt-get install nginx
autoindex on; #开启目录列表访问,合适下载服务器,默认关闭。
autoindex_localtime on | off;
service nginx restart
ln -s /var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu /usr/share/nginx/www/ubuntu


deb http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse

security updates proposed backports