免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 886 | 回复: 0
打印 上一主题 下一主题

redhat AS内网yum服务器 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-24 09:29 |只看该作者 |倒序浏览

#!/bin/bash
#    这是一个基于redhat as的更新与安装软件服务器初始化
#this is a redhat as5 update server build script
# mail me:zhanghaifeng@seaskyjoy.com or
maskway@gmail.com
#
tar xvf yumserver.tar.gz
rpm -ivh rpm/yum-3.0.*.rpm
rpm -ivh rpm/yum-metadata-parser*.rpm
rpm -ivh rpm/yum-rhn-plugin*.rpm
rpm -ivh rpm/yum-arch*.rpm
rpm -ivh rpm/yum-updatesd*.rpm
rpm -ivh rpm/createrepo*.rpm
rpm -ivh rpm/yum-ar*.rpm
rpm -ivh rpm/apr-1.*.i386.rpm
rpm -ivh rpm/post*.i386.rpm
rpm -ivh rpm/apr-ut*.i386.rpm
/etc/init.d/httpd start
#拷贝光盘资料到 mnt/cdrom1
#mount install dvd to /mnt/cdrom1
#
mkdir  /mnt/cdrom1
mount -t iso9660 /dev/cdrom /mnt/cdrom1
mkdir -p /var/www/html/rhs
cp -r /mnt/cdrom1/Server /var/www/html/rhs/
#cp -r /mnt/cdrom1/rhc/Server /var/www/html/rhs/
cp /mnt/cdrom1/RPM-GPG-KEY-redhat-release /var/www/html/rhs/Server &
#
#...web.....
chmod 777 -R /var/www/html/rhs
chown apache:apache -R /var/www/html/rhs
rm -rf /var/www/html/rhs/Server/.olddata
#..yum-arch
#
yum-arch /var/www/html/rhs/Server
createrepo /var/www/html/rhs/Server
#
#
# ..yum.conf
echo [Server] >> /etc/yum.conf
echo gpgkey=http://127.0.0.1/rhs/Server/RPM-GPG-KEY-redhat-release >> /etc/yum.conf
echo baseurl=http://127.0.0.1/rhs/Server >> /etc/yum.conf
#.....
mkdir -p /etc/yum.repos.d/backup
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
echo [Server] >> /etc/yum.repos.d/Server.repo
echo name=Red Hat as5  >> /etc/yum.repos.d/Server.repo
echo baseurl=http://127.0.0.1/rhs/Server  >> /etc/yum.repos.d/Server.repo
echo gpgcheck=1 >> /etc/yum.repos.d/Server.repo
echo gpgkey=http://127.0.0.1/rhs/Server/RPM-GPG-KEY-redhat-release >> /etc/yum.repos.d/Server.repo


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/15520/showart_1877482.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP