X-osadmin的自留地 X-osadmin的自留地
  • ? 博客主页•Index
  • ? 技术小絮·Tech
  • ✍ 点点滴滴·Diary
  • ? 作品发布·Works ↓
    • 下载中心
    • SpeedTest · 云测速
  • ? 专题文章·Catalogs
  • ? 友情链接
  • ? 博客主页•Index
  • ? 技术小絮·Tech
  • ✍ 点点滴滴·Diary
  • ? 作品发布·Works ↓
    • 下载中心
    • SpeedTest · 云测速
  • ? 专题文章·Catalogs
  • ? 友情链接
首页 技术小絮 CentOS下如何搭建Linux发行版镜像站

CentOS下如何搭建Linux发行版镜像站

xosadmin 4年前

最近正在忙活着搭建云鼎Linux镜像站。因为有很多朋友很想要一个这样的网站,并且在问如何搭建这类的网站。因此,X-osadmin为大家讲讲如何搭建。

废话不多说,进入正题~

 

一、环境准备

操作系统:CentOS 6.9 X86_64 (这里采用32位的系统亦可)

网络:1Gbps

硬盘:2x1tb HDD

 

二、安装前的准备工作

1. 更新系统软件包

# yum -y update

2.安装epel源

# yum -y install epel*

 

三、正式安装

1.安装各类依赖软件包

# yum -y install screen unzip nginx createrepo rsync

2.清理防火墙

# iptables -F

# iptables -X

# iptables -Z

# service iptables save && service iptables stop && chkconfig iptables off

3.设置部分程序开机启动

# chkconfig nginx on

4.配置nginx显示目录

# vi /etc/nginx/conf.d/default.conf

添加以下内容:

location / {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}

# service nginx reload

5.配置rsync同步脚本,这里请在网上自行搜罗上游同步服务器,这里以我在网上搜罗的CentOS镜像源为例,其他镜像源与此类似

# touch /root/rsync.sh && vi /root/rsync.sh

# mkdir /usr/share/nginx/html/centos

#!/bin/sh

rsync -avz rsync://mirrors.kernel.org/mirrors/centos /usr/share/nginx/html/centos

6.设置权限并后台启动rsync同步程序

# chmod +x /root/rsync.sh

# sh /root/rsync.sh &

通过以上步骤,您已经成功搭建起了一个简单的镜像站,但是没有配套自动同步。至于这方面内容,您可以参考网络上的cron计划任务进行同步。

0
猜你喜欢
  • Bark提示TokenExpired的解决方法
  • Debian 11启用rc.local方法
  • Debian 11通过apt安装proxmox 7
  • 为proxmox 6/7一键开启bbr
  • CentOS迁移后开机提示lvm not found的解决方法
  • curl: (35) Peer reports incompatible or unsupported protocol version的解决方法
评论 (0)
再想想
    暂无评论
xosadmin
站长
Codes learner / Love Linux & OpenWrt
110
文章
2
评论
0
获赞

文章聚合

  • ♥ X-osadmin’s Website ♥
  • 下载中心
  • 网站通知
  • Y-OS
  • 友情链接
  • 联系站长
  • X-osadmin’s Git Server
Copyright © 2016-2022 X-osadmin的自留地. Designed by nicetheme.