1.nginx提供目录浏览功能
| [root@kirin ~] |
| server { |
| listen 80; |
| listen [::]:80; |
| server_name mirrors.kirin7.com; |
| location / { |
| root /repo; |
| autoindex on; |
| } |
2.从公网的仓库同步软件包至本地,但需要注意,如果全同步,会特别占用空间,所以我们可以将不需要的软件包进行过滤。
rsync同步命令(建议将其加入定时任务)
| |
| rsync -zaP --exclude-from /repo/exclude_7.txt rsync://rsync.mirrors.ustc.edu.cn/centos/7.6.1810/ /repo/centos |
| |
| |
| rsync -zaP --exclude-from /repo/exclude_7_epel.txt rsync://rsync.mirrors.ustc.edu.cn/epel/7/ /repo/epel |
| |
| |
| [root@oldboyedu ~] |
| atomic/ |
| centosplus/ |
| cloud/ |
| configmanagement/ |
| cr/ |
| dotnet/ |
| fasttrack/ |
| isos/ |
| nfv/ |
| opstools/ |
| paas/ |
| rt/ |
| sclo/ |
| storage/ |
| virt/ |
| debug/ |
| drpms/ |
| |
| |
| [root@kirin ~] |
| SRPMS/ |
| aarch64/ |
| ppc64/ |
| ppc64le/ |
| state |
| |
3.客户端配置本地yum仓库
| [centos] |
| name = Local Base Repository |
| baseurl = http://mirrors.kirin7.com/centos |
| enable = 1 |
| gpgcheck = 0 |
| |
| [epel] |
| name = Local Epel Repository |
| baseurl = http://mirrors.kirin7.com/epel |
| enable = 1 |
| gpgcheck = 0 |
| |
4.扩展:如果想为下游提供同步服务,我们可以使用rsync协议将目录共享出去,让其他人也可以同步(一般玩不起,毕竟没钱)。
| [root@kirin ~] |
| uid = nginx |
| gid = nginx |
| use chroot = no |
| max connections = 2000 |
| timeout = 600 |
| pid file = /var/run/rsyncd.pid |
| lock file = /var/run/rsync.lock |
| log file = /var/log/rsyncd.log |
| |
| ignore errors |
| read only = true |
| list = true |
| hosts allow = 0.0.0.0/0 |
| |
| |
| [centos] |
| path = /repo/centos |
| [epel] |
| path = /repo/epel |
| |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!