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

原本准备像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

fancyindex_ignore:哪些文件/目录隐藏掉

fancy指令使用:

fancyindex

语法: *fancyindex* [*on* | *off*]

默认值: fancyindex off

配置块: http, server, location

描述: 开启/关闭目录索引功能

fancyindex_css_href

语法: *fancyindex_css_href uri*

默认值: fancyindex_css_href ""

配置块: http, server, location

描述: 外置css路径,可以用这个css替代掉现有的css样式

fancyindex_exact_size

语法: *fancyindex_exact_size* [*on* | *off*]

默认值: fancyindex_exact_size on

配置块: http, server, location

描述: 定义如何显示文件的大小,默认是on,on:文件大小使用精确值,单位为字节.off:单位为KB,MB,GB,如果含有小数点,将会四舍五入。例如1.9MB,将会显示为2MB。

fancyindex_footer

语法: *fancyindex_footer path*

默认值: fancyindex_footer ""

配置块: http, server, location

描述: 指定哪个文件嵌入到索引页面的底部

fancyindex_header

语法: *fancyindex_header path*

默认值: fancyindex_header ""

配置块: http, server, location

描述: 指定哪个文件嵌入到索引页面的头部.用法和fancyindex_footer类似

fancyindex_ignore

语法: *fancyindex_ignore string1 [string2 [… stringN]]*

默认值: No default.

配置块: http, server, location

描述: 哪些文件/目录隐藏掉,支持nginx正则

fancyindex_localtime

语法: *fancyindex_localtime* [*on* | *off*]

默认值: fancyindex_localtime off

配置块: http, server, location

Description: 使用当地时间显示文件的创建时间,默认是off(GMT时间)

4. 同步ustc centos镜像

mkdir -p /home/wwwroot/mirrors.linuxeye.com/centos

tmux #后台同步

rsync -avrt rsync://mirrors.ustc.edu.cn/centos/ \

--exclude-from=/home/wwwroot/mirrors.linuxeye.com/exclude_centos.list \

/home/wwwroot/mirrors.linuxeye.com/centos/

Mon Feb 9 15:49:50 CST 2015

linux开源镜像站 目录帮助,LinuxEye开源镜像站运营相关推荐

  1. linux配置163镜像,修改yum使用163开源镜像升级CentOS

    yum使用http://mirror.centos.org/的镜像升级和下载软件有点小慢,现在网易干了件好事就是有了http://mirrors.163.com/这个开源镜像站,速度还不是一般的快. ...

  2. 2、Linux的常见发行版、开源协议、目录结构及哲学思想

    2.Linux的常见发行版.开源协议.目录结构及哲学思想 Linux的常见发行版: 开源协议: linux目录结构以及各目录下存放的文件: Linux的哲学思想: Linux的常见发行版: 1.Red ...

  3. 开发常用镜像资源替换为国内开源镜像(yum,compose,maven,docker,android sdk,npm,国内开源镜像汇总)...

    一.国内开源镜像站点汇总 阿里云开源镜像站 (http://mirrors.aliyun.com/) 网易开源镜像站 (http://mirrors.163.com/) 中国科学技术大学开源镜像站 ( ...

  4. AI周报丨标清变4k?B站超分辨率算法开源;强化学习算法控制核聚变登上《nature》

    AI周刊丨标清变4k?B站超分辨率算法开源:强化学习算法控制核聚变登上<nature> 2022年2月22日 极链AI云 文章目录 AI周刊丨标清变4k?B站超分辨率算法开源:强化学习算法 ...

  5. linux 邮件客户端 n1,N1:下一代开源邮件客户端

    N1 Open Source email client 当我们谈论到Linux中的邮件客户端,通常 Thunderbird.Geary 和 Evolution 就会出现在我们的脑海.作为对这些大咖们的 ...

  6. Linux学习总结(78)—— 常见开源协议讲解

    不根据协议使用开源软件可能面临的风险 2003 年 Linksys 公司(同年 3 月被思科收购)推出 WRT-54G,这款路由器采用了基于 Linux 的固件,而 Linux 使用的是 GPL 开源 ...

  7. Linux基金会执行董事Jim Zemlin:开源世界迷人的未来

    导读:本文编译自Linux基金会执行董事Jim Zemlin在2021年6月17-18日第十六届开源中国开源世界高峰论坛上所做的报告分享.在分享中,Jim对Linux成立30周年期间加入的一些好的项目 ...

  8. 对Linux既拉又打 微软与开源的“爱恨情仇”

    对Linux既拉又打 微软与开源的"爱恨情仇"[@more@] 微软最近加强与Linux 互操作性的努力和吸引开发商转向Windows 平台的计划反映了微软对开放源代码软件既爱又恨 ...

  9. Linux 基金会执行董事 Jim Zemlin:开源如何成为创新的关键推动力

    2023年6月15日,由中国开源软件推进联盟主办,赛迪传媒.<软件和集成电路>杂志社联合承办的"第十八届开源中国开源世界高峰论坛"在北京盛大召开.Linux 基金会执行 ...

最新文章

  1. HDU 2022 海选女主角
  2. matlab的边缘检测方法,MATLAB应用—Matlab多种图像边缘检测方法
  3. Linux部署Ant Design Pro项目及nginx部署
  4. boost::variant2模块转换构造抛出相关的测试程序
  5. nagios系列(七)nagios通过自定义脚本的方式监控mysql主从同步
  6. python导入pandas具体步骤方法_python导入pandas具体步骤方法-
  7. Unity shader入门之数据类型
  8. win10录屏工具_win10录屏软件选哪款?没用过别后悔
  9. 视图与表之间的异同点_灯芯绒面料印花与染色的异同点有哪些?做灯芯绒订单的了解一下...
  10. 13 大论坛同开播!数百专家带你从机器学习技术与工程实践,聊到开源生态 | AI ProCon 2020...
  11. MS SQL入门基础:存储过程概述
  12. 老李分享云计算基本概念 2
  13. win7升级自带ie8到ie11版本(在不能联网的状态下)
  14. 基于鸿蒙js框架实现的wearable五子棋软件
  15. PLSQL 官方下载及安装
  16. 从高德地图获取城市地铁线路+站点
  17. 提高网站速度,分析工具page speed中文教程
  18. 下一代Windows命名为Win 11?微软的下一步要来了
  19. web.py mysql_webpy连接mysql出现问题
  20. Pandas操作Excel,统计pass/fail的个数

热门文章

  1. DesignPattern_Java:Proxy Pattern
  2. 解决虚拟机VMware运行Ubuntu时无法和主机之间复制粘贴的问题
  3. Java 提示“找不到或无法加载主类” 解决方法
  4. 霍强:创新研究到底应该怎么做?
  5. 旅行场景下的推荐算法探索
  6. 【推荐论文】基于多视角学习和个性化注意力机制的新闻推荐(附论文下载链接)...
  7. Function与Module的差异与应用场景
  8. linux怎么用网络yum源,Linux配置本地网络YUM源
  9. matlab 模拟滤波器转换为数字滤波器,一种模拟滤波电路数字化方法
  10. docker部署在linux怎么代理,如何在linux 上部署docker