LinuxEye开源镜像站运营

LinuxEye开源镜像站运营,第1张

LinuxEye开源镜像站运营

技术在于折腾,最近手上有空闲国内服务器资源,于是忍不住折腾,为了方便广大开源爱好者下载Linux发行版,Linux运维笔记自己搭建了一个镜像网站。

LinuxEye开源镜像站网址:http://mirrors.linuxeye.com/

原本准备像mirrors.ustc.edu.cn镜像整个包,但是服务器磁盘容量有限,于是LinuxEye只收录最新版本(mini)的策略,镜像定期更新获取最新版本的Linux发行版,并自动替换所在目录,包含对应md5值

ps:如果大家有什么特别需要的发行版,请回帖,可以考虑加到镜像站中,谢谢!

LinuxEye开源镜像站搭建过程

1. 使用《lnmp一键安装包》,安装lnmp,执行vhost.sh 添加虚拟主机mirrors.linuxeye.com

2. 在nginx中添加fancyindex模块实现漂亮的索引目录

    cd lnmp/src
    wget http://gitorious.org/ngx-fancyindex/ngx-fancyindex/archive-tarball/master
    tar xvzf master
    # /usr/local/nginx/sbin/nginx -V #查看nginx已经编译参数
    cd nginx-1.6.2
    make clean
    #增加ngx-fancyindex模块(--add-module=../ngx-fancyindex-ngx-fancyindex)
    ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module 
    --with-http_spdy_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module 
    --with-http_flv_module --with-ld-opt=-ljemalloc --add-module=../ngx-fancyindex-ngx-fancyindex
    make
    mv /usr/local/nginx/sbin/nginx{,_`date +%F`}
    cp objs/nginx /usr/local/nginx/sbin

3. 修改虚拟主机配置文件(/usr/local/nginx/conf/vhost/mirrors.linuxeye.com.conf)

    server {
    listen 80;
    server_name mirrors.linuxeye.com;
    access_log off;
    index index.html index.htm index.php;
    root /home/wwwroot/mirrors.linuxeye.com;
    location / {
    fancyindex on;
    fancyindex_exact_size off;
    fancyindex_localtime on;
    fancyindex_footer "/footer.html";
    fancyindex_ignore "footer.html" "exclude_centos.list";
    }
    }

参数解释:

fancyindex on:开启fancy索引

fancyindex_exact_size off:不使用精确的大小,使用四舍五入,1.9M会显示为2M这样.如果开启的话,单位为字节

fancyindex_localtime on:使用本地时间

fancyindex_footer /footer.html:把网站根目录下footer.html内容作为底部.文件不存在底部会出现404

footer.html内容如下:

    
    
    
    
    
    
    版权所有 © copy; 2015 LinuxEye  					
    										
    
    
    					

    欢迎分享,转载请注明来源:内存溢出

    原文地址: https://www.outofmemory.cn/zaji/3012655.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-09-28
下一篇 2022-09-28

发表评论

登录后才能评论

评论列表(0条)

保存