linux系统http镜像源的搭建

一、搭建前的准备工作:

1、准备镜像文件并上传到服务器,上传步骤不多说,可以通过sftp、ftp、rz来上传

rhel-server-5.5-x86_64-dvd.iso

rhel-server-5.8-x86_64-dvd.iso

2、搭建http环境,这是必要的。有多种软件可以选择:nginx、apache、lighthttp、tomcat,搭建步骤祥见<<lnmp环境搭建文档>:>

http环境:nginx

安装目录:/usr/local/webserver/nginx/

二、开始搭建http镜像源环境:

1、创建挂载镜像目录:

#cd /usr/local/webserver/nginx/html/

#mkdir  -p redhat/redhat5.5   redhat/redhat5.8

2、进入镜像的上传目录挂载镜像文件:

#cd   /usr/ftpfiles/

#mount /usr/ftpfiles/rhel-server-5.5-x86_64-dvd.iso /usr/local/webserver/nginx/html/rehat/redhat5.5/ -o loop

#mount /usr/ftpfiles/rhel-server-5.8-x86_64-dvd.iso /usr/local/webserver/nginx/html/rehat/redhat5.8/ -o loop

三、客户端设置镜像源:

1、设置repo文件指向http源:

#cd /etc/yum.repos.d/

#vi  http.repo

[rhel-debuginfo]
name=Red Hat Enterprise Linux 
baseurl=http://192.168.18.156/rehat/redhat8/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

然后保存退出

2、运行yum命令

#yum clean all

#yum list


#yum grouplist


3、根据需要安装自己想要的软件包:

#yum install  apache  mysql  

#yum groupinstall  "X Software Development"


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值