星空网 > 软件开发 > 操作系统

RedHat7搭建yum源服务器

1.新建目录

# mkdir -p /content/rhel7.1/x86_64/{isos,dvd}/

2.上传RedHat安装光盘镜像,上传后的路径为 /content/rhel7.1/x86_64/isos/rhel-server-7.1-x86_64-dvd.iso

3.设置开机自动挂载光盘镜像到/content/rhel7.1/x86_64/dvd

# echo "/content/rhel7.1/x86_64/isos/rhel-server-7.1-x86_64-dvd.iso   /content/rhel7.1/x86_64/dvd   iso9660   loop,ro   0 0" >> /etc/fstab

# mount -a

4.搭建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

5.创建yum源网站(http://content.example.com)配置文件

# vi /etc/nginx/conf.d/content.example.com.conf

server {  listen    80;  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 404       /404.html;  # redirect server error pages to the static page /50x.html  #  error_page  500 502 503 504 /50x.html;  location = /50x.html {    root  /usr/share/nginx/html;  }}

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.修改网站目录SELinux类型

# chcon -t public_content_t -R /content/

9.设置nginx服务开机自启动,并启动nginx服务

# systemctl enable nginx

# systemctl start nginx

10.创建repo文件

# vi /etc/yum.repos.d/rhel-dvd.repo

[rhel-dvd]name=remote ipa copy of dvdbaseurl=http://content.example.com/rhel7.1/x86_64/dvdgpgcheck=0enabled=1

11.生成repo cache,用来测试新yum源是否生效

# yum makecache




原标题:RedHat7搭建yum源服务器

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

Vestiaire Collective怎么发货?运费多少钱:https://www.goluckyvip.com/news/6056.html
东南亚跨境电商靠谱吗?东南亚选品;食品出海:https://www.goluckyvip.com/news/6057.html
海外仓对跨境电商有哪些意义:https://www.goluckyvip.com/news/6058.html
跨境市场新风口:东南亚这国电商市场大热!:https://www.goluckyvip.com/news/6059.html
新规:埃及出口商注册制增加4类商品,否则无法清关!:https://www.goluckyvip.com/news/606.html
Lazada核心功能:多国评论互通、图片一键翻译:https://www.goluckyvip.com/news/6060.html
零售晚报:携程发布318成绩单 近800万商家GMV增长101% :https://www.kjdsnews.com/a/1836405.html
19点聊电商:百度云:大模型应用元年 企业如何先“卷”一步? :https://www.kjdsnews.com/a/1836406.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流