RHEL5建立自己的yum源服务器(基于http方式)

简介: 为了解决软件包的依赖问题,红帽系列发行版最好的方式是利用yum,用rhel安装光盘文件里的文件构建yum源,这里以http方式(还可以本地光盘方式,本地文件方式),本文记录简要过程,仅供参考。

为了解决软件包的依赖问题,红帽系列发行版最好的方式是利用yum,用rhel安装光盘文件里的文件构建yum源,这里以http方式(还可以本地光盘方式,本地文件方式),本文记录简要过程,仅供参考。
      
    1.挂载安装光盘到系统

mount /dev/cdrom /media/



      2.复制文件到web服务器rhel5目录下

cp -fr /media/* /var/www/htm/rhel5



      3.重建记录分组文件
  首先,确认系统已经安装createrepo包。

cd /var/www/htm/rhel5/Server
rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm



然后重建rpm记录分组文件

createrepo -g /var/www/html/rhel5/VT/repodata/comps-rhel5-vt.xml /var/www/html/rhel5/VT

createrepo -g /var/www/html/rhel5/Cluster/repodata/comps-rhel5-cluster.xml /var/www/html/rhel5/Cluster

createrepo -g /var/www/html/rhel5/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /var/www/html/rhel5/ClusterStorage

createrepo -g /var/www/html/rhel5/Server/repodata/comps-rhel5-server-core.xml /var/www/html/rhel5/Server



     4.在/etc/yum.repos.d目录下建立repo库文件 rhel5-http.repo
        (注:此文件名任意,文件后缀名必须是repo)

cd /etc/yum.repos.d

 

vi rhel5-http.repo

#我的机器IP是为192.168.171.3

Quotation
[Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=http://192.168.171.3/rhel5/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - ClusterStorage
baseurl=http://192.168.171.3/rhel5/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Server
baseurl=http://192.168.171.3/rhel5/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[VT]
name=Red Hat Enterprise Linux $releasever - $basearch - VT
baseurl=http://192.168.171.3/rhel5/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

   5.清除本机yum缓存
yum clean all

    6.测试

yum -y install vim*

 

Quotation
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
Package 2:vim-minimal-7.0.109-4.el5_2.4z.i386 already installed and latest version
Package 2:vim-common-7.0.109-4.el5_2.4z.i386 already installed and latest version
Package 2:vim-enhanced-7.0.109-4.el5_2.4z.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package vim-X11.i386 2:7.0.109-4.el5_2.4z set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
Package                    Arch                    Version                                  Repository                 Size
=============================================================================================================================
Installing:
vim-X11                    i386                    2:7.0.109-4.el5_2.4z                     Server                    1.4 M

Transaction Summary
=============================================================================================================================
Install      1 Package(s)        
Update       0 Package(s)        
Remove       0 Package(s)        

Total download size: 1.4 M
Downloading Packages:
vim-X11-7.0.109-4.el5_2.4z.i386.rpm                                                                   | 1.4 MB     00:00    
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186
Importing GPG key 0x37017186 "Red Hat, Inc. (release key) " from /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : vim-X11                                           [1/1]

Installed: vim-X11.i386 2:7.0.109-4.el5_2.4z
Complete!



  
8.配置web服务器,默认目录指定到rhel 源位置.

目录
相关文章
|
2月前
|
安全 Apache
Metasploit -- 对Apache HTTP服务器守护进程中断复现
Metasploit -- 对Apache HTTP服务器守护进程中断复现
20 0
|
1月前
|
网络协议 Shell 网络安全
实验目的1.编译安装httpd2.优化路径3.并将鲜花网站上传到web服务器为网页目录4.在客户机访问网站http://www.bdqn.com
实验目的1.编译安装httpd2.优化路径3.并将鲜花网站上传到web服务器为网页目录4.在客户机访问网站http://www.bdqn.com
163 0
|
3天前
|
XML Java 数据格式
Servlet 教程 之 Servlet 服务器 HTTP 响应 3
`Servlet`教程示例展示了如何创建一个HTTP响应,使用`@WebServlet("/Refresh")`的`Refresh`类继承`HttpServlet`。在`doGet`方法中,设置了`Refresh`头以每5秒自动刷新,并用`setContentType("text/html;charset=UTF-8")`设定内容类型。还使用`Calendar`和`SimpleDateFormat`获取并格式化当前时间显示。相应的`web.xml`配置指定了Servlet路径。当访问此Servlet时,页面将每5秒更新一次显示的系统时间。
14 4
|
1月前
|
Shell Linux 网络安全
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
30 0
|
1月前
|
Shell Linux Apache
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 apachectl命令 使用教程
162 1
|
1月前
|
数据采集 缓存 前端开发
http和https请求服务器的时候在请求头部分都带什么到服务器呢?
HTTP和HTTPS请求头基本结构相似,HTTPS多了一层SSL/TLS加密。常见请求头如Accept(指定内容类型)、Authorization(身份验证)、Cookie(会话跟踪)、User-Agent(标识用户代理)等。HTTPS特有的头包括Upgrade-Insecure-Requests(升级到HTTPS)、Strict-Transport-Security(强制使用HTTPS)、Sec-Fetch-*(安全策略)和X-Content-Type-Options、X-Frame-Options等(增强安全性)。实际应用中,请求头会根据需求和安全策略变化。
20 0
|
1月前
|
存储 数据采集 负载均衡
建立HTTP代理IP池的技术和工具支持
建立HTTP代理IP池的技术和工具支持
45 0
|
1月前
|
JSON 缓存 中间件
Go语言网络编程:深入探索HTTP服务器开发
【2月更文挑战第12天】本文将详细探讨使用Go语言开发HTTP服务器的过程,包括HTTP协议的理解、Go标准库中`net/http`包的使用、路由处理、中间件、静态文件服务、JSON处理以及性能优化等方面。通过本文,读者将能够掌握构建高效、可扩展HTTP服务器的关键技术。
|
2月前
|
移动开发 编解码 网络协议
用Java的BIO和NIO、Netty来实现HTTP服务器(三) 用Netty实现
用Java的BIO和NIO、Netty来实现HTTP服务器(三) 用Netty实现
|
2月前
|
网络协议 Java Linux
用Java来实现BIO和NIO模型的HTTP服务器(二) NIO的实现
用Java来实现BIO和NIO模型的HTTP服务器(二) NIO的实现