在公司局域网建立一个 REDHAT LINUX更新服务器

原创 2011年01月21日 09:04:00

这是06年帮公司做的一个在公司内部更新redhat linux服务器

这里以Fedora3为例:

首先确定http服务是可以用

在/var/www/html/ 后建立目录yum/Fedora/Corel/3/base

建立后目录:/var/www/html/yum/Fedora/Corel/3/base

同样建立目录:/var/www/html/yum/Fedora/Corel/3/updates

将Fedora3安装盘base下所有文件抄一份到:/var/www/html/yum/Fedora/Corel/3/base

建立一个自动更新文件:yum_update.cron  (文件名自定)
保存在目录/etc/cron.daily/
以下是我的内容:

##### for redhat fedora3  #####
rsync -avz rsync://rpmfind.net/linux/fedora/core/updates/3/i386/*.rpm /var/www/html/yum/Fedora/Core/3/updates
createrepo /var/www/html/yum/Fedora/Core/3/updates

##### for redhat fedora4  #####
rsync -avz rsync://rpmfind.net/linux/fedora/core/updates/4/i386/*.rpm /var/www/html/yum/Fedora/Core/4/updates
createrepo /var/www/html/yum/Fedora/Core/4/updates

##### for redhat fedora5  #####
rsync -avz rsync://rpmfind.net/linux/fedora/core/updates/5/i386/*.rpm /var/www/html/yum/Fedora/Core/5/updates
createrepo /var/www/html/yum/Fedora/Core/5/updates

##### for redhat fedora6  #####
rsync -avz rsync://rpmfind.net/linux/fedora/core/updates/6/i386/*.rpm /var/www/html/yum/Fedora/Core/6/updates
createrepo /var/www/html/yum/Fedora/Core/6/updates

##### for linux centos4.2  #####
rsync -avz rsync://rsync.oss.eznetsols.org/ftp/linux/centos/4.2/os/i386/ /var/www/html/yum/Centos/4.2/base/
rsync -avz rsync://rsync.oss.eznetsols.org/ftp/linux/centos/4.2/updates/i386/ /var/www/html/yum/Centos/4.2/updates/

##### for linux centos4.3  #####
rsync -avz rsync://rsync.oss.eznetsols.org/ftp/linux/centos/4.3/os/i386/ /var/www/html/yum/Centos/4.3/base/
rsync -avz rsync://rsync.oss.eznetsols.org/ftp/linux/centos/4.3/updates/i386/ /var/www/html/yum/Centos/4.3/updates/

rsync -avz rsync://mirrors.kernel.org/fedora/extras/3/i386/*.rpm  /var/www/html/yum/Fedora/Core/3/extras/i386/
createrepo /var/www/html/yum/Fedora/Core/3/extras/i386

rsync -avz rsync://mirrors.kernel.org/fedora/extras/4/i386/*.rpm  /var/www/html/yum/Fedora/Core/4/extras/i386/
createrepo /var/www/html/yum/Fedora/Core/4/extras/i386

rsync -avz rsync://mirrors.kernel.org/fedora/extras/5/i386/*.rpm  /var/www/html/yum/Fedora/Core/5/extras/i386/
createrepo /var/www/html/yum/Fedora/Core/5/extras/i386

rsync -avz rsync://mirrors.kernel.org/fedora/extras/6/i386/*.rpm  /var/www/html/yum/Fedora/Core/6/extras/i386/
createrepo /var/www/html/yum/Fedora/Core/6/extras/i386

##### for linux kernel v2.6  #####
rsync -avz rsync://kernel.org/pub/linux/kernel/v2.6/ /var/www/html/yum/Kernel/v2.6/

192.168.4.252是服务器IP

将首页照搬上来:

Yellowdog Updater Server


    Fedora3    Fedora4    Fedora5    Fedora6   CentOS    Kernel


Fedora3      

Configuring Fedora clients There are two ways that allow you to update local Fedora clients to download updates from our new server. The first is 'yum' (command line) and second 'up2date' (graphical). Up2date uses yum anyway. To continue with yum as your solution, open the /etc/yum.repos.d/fedora.repo file in VI or you editor of choice and change the entries as below.

[base]
name=Fedora Core $releasever - $basearch - Base
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=http://192.168.4.252/yum/Fedora/Core/3/base/
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1
download:fedora.repo(for fc3)
Open the /etc/yum.repos.d/fedora-updates.repo file and change the entries as below.
[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
baseurl=http://192.168.4.252/yum/Fedora/Core/3/updates/ 
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc/$releasever
enabled=1
gpgcheck=1
download:fedora-updates.repo(for fc3)
Save the changes to these files.
Almost there. You need to install the public key from Fedora. Enter the folowing command:
rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora 
NOW you are ready. At the client, enter the following command:
yum update

Fedora4      

Configuring Fedora clients There are two ways that allow you to update local Fedora clients to download updates from our new server. The first is 'yum' (command line) and second 'up2date' (graphical). Up2date uses yum anyway. To continue with yum as your solution, open the /etc/yum.repos.d/fedora.repo file in VI or you editor of choice and change the entries as below.

[base]
name=Fedora Core $releasever - $basearch - Base
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=http://192.168.4.252/yum/Fedora/Core/4/base/
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1

download:fedora.repo(for fc4)
Open the /etc/yum.repos.d/fedora-updates.repo file and change the entries as below.
[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
baseurl=http://192.168.4.252/yum/Fedora/Core/4/updates/
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc/$releasever
enabled=1
gpgcheck=1

download:fedora-updates.repo(for fc4)
Save the changes to these files.
Almost there. You need to install the public key from Fedora. Enter the folowing command:
rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora 
NOW you are ready. At the client, enter the following command:
yum update

CentOS4.2

CentOS4.3


Kernel

Linux下局域网文件服务器的建立

  • 2011年04月25日 09:11
  • 123KB
  • 下载

Linux下局域网邮件服务器的建立

  • 2011年12月03日 11:50
  • 121KB
  • 下载

解决公司oracle数据库服务器,在不能上网的情况下数据库也能正常的在局域网中使用

解决公司oracle数据库服务器,在不能上网的情况下数据库也能正常的在局域网中使用 2011-12-16 公司碰到了3次这种情况,昨天碰到之后一直没有找到方法解决,今天早上在上班之前还是不放心的打...

Maven3 安装使用(三)--搭建公司局域网maven服务器

四、搭建公司局域网的Maven服务器 如果在公司里使用Maven,通常应该在本地架设一个Maven资源仓库服务器,在代理远程资源仓库的同时维护本地资源仓库。 第一步: 下载Nexus ...
  • tojinbo
  • tojinbo
  • 2013年01月05日 16:43
  • 492

Redhat_Linux 搭建SVN服务器完全手册

  • 2013年08月09日 10:33
  • 515KB
  • 下载

node.js 搭载的一个服务器,局域网内,都可以访问

var http = require(‘http’), url = require(‘url’), path = require(‘path’), fs = require(‘fs’)...

javaweb--Tomcat>>添加虚拟主机&&在同一个局域网下访问服务器应用

添加虚拟主机&&在局域网下访问
  • TMRsir
  • TMRsir
  • 2016年08月06日 16:14
  • 290
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:在公司局域网建立一个 REDHAT LINUX更新服务器
举报原因:
原因补充:

(最多只允许输入30个字)