RedHat7搭建yum源服务器
1.新建目录
# mkdir -p /content/rhel7/x86_64/{isos,dvd}/
2.上传RedHat安装光盘镜像,上传后的路径为 /content/rhel7/x86_64/isos/rhel-server-7.2-x86_64-dvd.iso
3.搭建http服务器(nginx),用来网络访问这个yum源
# rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
# yum -y install nginx
4.创建yum源网站(http://content.example.com)配置文件
# vi /etc/nginx/conf.d/content.example.com.conf
server {
listen ;
server_name content.example.com;
access_log /var/log/nginx/content.example.com.access.log combined;
location / {
root /content;
index index.html index.htm;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
#error_page /.html;
# redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
5.修改网站目录SELinux类型
# chcon -t public_content_t -R /content/
6.添加DNS记录到/etc/hosts文件
# echo "192.168.136.254 content.example.com" >> /etc/hosts
7.开通防火墙
# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload
8.设置nginx服务开机自启动,并启动nginx服务
# systemctl enable nginx
# systemctl start nginx
9.设置开机自动挂载光盘镜像到/content/rhel7/x86_64/dvd
# echo "/content/rhel7/x86_64/isos/rhel-server-7.2-x86_64-dvd.iso /content/rhel7/x86_64/dvd iso9660 loop,ro 0 0" >> /etc/fstab
# mount -a
10.创建repo文件
# vi /etc/yum.repos.d/rhel-dvd.repo
本机:
[rhel-dvd]
name=rhel dvd
baseurl=file:///content/rhel7/x86_64/dvd
gpgcheck=
enable=
局域网内其他服务器:
[rhel-dvd]
name=remote copy of dvd
baseurl=http://content.example.com/rhel7/x86_64/dvd
gpgcheck=
enabled=
11.生成repo cache,用来测试新yum源是否生效
# yum makecache
RedHat7搭建yum源服务器的更多相关文章
- FTP搭建YUM源服务器
一.FTP搭建YUM源服务器 1.服务器 挂载centos镜像[root@localhost ~]#yum install vsftpd[root@localhost ~]#systemctl sta ...
- 基于http方式搭建YUM源服务器
基于http方式搭建YUM源服务器 (2012-09-21 11:59:14) 转载▼ 标签: yum linux lnmp lamp http 分类: Linux 为了方便公司80多台Linux服务 ...
- 基于nginx搭建yum源服务器
1.首先关闭防护墙或者设置规则通过且关闭selinux 停止firewall systemctl stop firewalld 禁止firewall开机启动 systemctl disable f ...
- 搭建yum源服务器
在生产环境中,受到网络环境的影响,服务器可能带宽有限,连外网速度较慢或者局域网内的某些机器由于安全的限制,本身就不允许和外网和任何的连接.而这时候现在通过yum安装包或update包时就是一件比较麻烦 ...
- CDH 5.5.1 Yum源服务器搭建
CDH 5.5.1 Yum源服务器搭建 下载Cloudera Repo #下载资源仓库repo wget https://archive.cloudera.com/cdh5/redhat/6/x86_ ...
- CentOS7下的YUM源服务器搭建详解,过程写的很详细(转)
因为近期公司需要搭建一个YUM源服务器给大量的linux(mini)使用,所以因此在网上找了很多的教程,却没有一个特别详细的,很多都有遗漏,参差不齐.所以,打算自己做完之后方便以后查阅,特出此文档. ...
- redhat7搭建本地yum仓库
ftp服务器搭建 安装vsftpd yum install vsftpd 配置启动服务和防火墙 修改配置,由于默认不开启主动模式,需要配置开启,在/etc/vsftpd/vsftpd.conf添加如下 ...
- 搭建本地yum源服务器
搭建本地yum源服务器 好久没写博客了,最近比较动荡,临毕业时跳了个槽,感觉之前做的金融方向的运维不是很适合我,对各方面的限制还是太多.金融的IT对于安全似乎要求很高,云盘,U盘都不能用,还要经常 ...
- 搭建YUM仓库
概述 YUM 主要用于自动安装.升级 rpm 软件包,它能自动查找并解决 rpm 包之间的依赖关系.要功的使用 YUM 工具安装更新软件或系统,就需要有一个包含各种 rpm 软件包的 reposito ...
随机推荐
- 优秀android开源项目与解决方案推荐
后来加上的,因为太强大了,android上百个可立即使用的开源库介绍:https://github.com/Trinea/android-open-project Android上的FTP服务器 S ...
- cocos2d-x 纹理深入研究 第二部分
转自:http://blog.csdn.net/qq51931373/article/details/9152227 1.纹理控制. 看此代码: CCSprite *pSprite = CCSprit ...
- HDU 5842 Lweb and String (水题)
Lweb and String 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5842 Description Lweb has a string S ...
- jQuery基础学习8——层次选择器children()方法
$('body > div').css("background","#bbffaa"); //和children()方法是等价的,父子关系,和parent ...
- CentOs中iptables配置允许mysql远程访问
在CentOS系统中防火墙默认是阻止3306端口的,我们要是想访问mysql数据库,我们需要这个端口,命令如下: 1 /sbin/iptables -I INPUT -p tcp --dport 30 ...
- ASP.NET网站中设置404自定义错误页面
在用ASP.NET WebForm开发一个网站时,需要自定义404错误页面. 做法是这样的 在网站根目录下建立了一个404.html的错误页面,然后在Global.asax文件中,加入如下代码: &l ...
- ASP.Net自定义重写Http Server标头
Net中我们为了安全或其他原因起见 可能需要修改我们的标头报文等 以下方法我们通过使用HTTP Module来使用编程的方式来去除或修改它 首先我们自定义一个类CustomServerHeaderMo ...
- CentOS服务器配置发送邮件服务
CentOS服务器配置发送邮件服务 lsb_release -a 查看linux系统版本 在CentOS6以上版本自带mailx版本12.4 rpm -qa | grep mailx 查看系统自带的m ...
- UIButton的imageEdgeInsets 和 titleEdgeInsets
我们知道,在UIButton中有一个UILabel和一个UIImageView,同时还有属性: titleEdgeInsets,imageEdgeInsets.介绍下 imageEdgeInsets ...
- SQL Delta实用案例介绍 (对应软件)
http://blog.csdn.net/hongdi/article/details/5363209