制作局域网http的yum源

1、下载安装包到本地,以下载vim软件包为例

yum install --downloadonly --downloaddir=/opt/download vim

2、将安装包拷贝至局域网预先设置好的yum服务器

[root@localhost yum]# cd /opt/yum        进入到软件包所在文件夹
[root@localhost yum]# createrepo .     创建每个软件包元数据
[root@localhost yum]# createrepo update  软件仓库中含有很多的软件包,虽然只是其中的一小部分有所改动但是你却不必为每个软件包重新产生元数据,这样做明显太浪费时间了

3、安装httpd服务器

[root@localhost yum]# yum -y install httpd
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* extras: mirrors.ustc.edu.cn* updates: mirrors.ustc.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 httpd.x86_64.0.2.4.6-97.el7.centos 将被 安装
--> 正在处理依赖关系 httpd-tools = 2.4.6-97.el7.centos,它被软件包 httpd-2.4.6-97.el7.centos.x86_64 需要
--> 正在处理依赖关系 /etc/mime.types,它被软件包 httpd-2.4.6-97.el7.centos.x86_64 需要
--> 正在处理依赖关系 libaprutil-1.so.0()(64bit),它被软件包 httpd-2.4.6-97.el7.centos.x86_64 需要
--> 正在处理依赖关系 libapr-1.so.0()(64bit),它被软件包 httpd-2.4.6-97.el7.centos.x86_64 需要

4、启动httpd服务,并查看运行状态

[root@localhost /]# systemctl enable httpd  //开机自启动
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@localhost /]# systemctl start httpd  //开启服务
[root@localhost /]# systemctl status httpd  //查看服务状态
● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)Active: active (running) since 六 2021-01-23 19:11:22 PST; 6s agoDocs: man:httpd(8)man:apachectl(8)Main PID: 23938 (httpd)Status: "Processing requests..."CGroup: /system.slice/httpd.service├─23938 /usr/sbin/httpd -DFOREGROUND├─23941 /usr/sbin/httpd -DFOREGROUND├─23942 /usr/sbin/httpd -DFOREGROUND├─23943 /usr/sbin/httpd -DFOREGROUND├─23944 /usr/sbin/httpd -DFOREGROUND└─23945 /usr/sbin/httpd -DFOREGROUND1月 23 19:11:22 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
1月 23 19:11:22 localhost.localdomain httpd[23938]: AH00558: httpd: Could not reliably determine the server's fully qu...ssage
1月 23 19:11:22 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

5、关闭selinux:

1)暂时关闭,重启后失效
[root@localhost yum]# getenforce        //运行命令 getenforce 获取当前selinux状态(Enforcing为开启)
Enforcing
[root@localhost yum]# setenforce 0      //运行命令 setenforce 0
[root@localhost yum]# getenforce       //运行命令getenforce,状态变为 Permissive
Permissive
2)永久关闭

运行命令: vim /etc/sysconfig/selinux


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled    #找到行:SELINUX=enforcing  替换为:SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

重启后,运行命令 sestatus

[root@localhost yum]# sestatus
SELinux status:                 `disabled`
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          disabled
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

永久关闭selinux成功

6、创建软链接

[root@localhost /]# ln -s /opt/yum/ /var/www/html/centos
[root@localhost /]# ll /var/www/html/
总用量 0
lrwxrwxrwx. 1 root root 9 1月  23 19:13 centos -> /opt/yum/

7、访问该页面

8、配置主机的yum指向这个yum源

[root@localhost /]# vim /etc/yum.repos.d/centos.repo
[centos]
name=centos
baseurl=http://192.168.1.119/centos
gpgcheck=0
enabled=1

9、查看yum源信息

[root@localhost /]# yum repolist
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识                                                       源名称                                                       状态
centos                                                       centos                                                       3,894
repolist: 3,894

Centos7制作局域网http的yum源相关推荐

  1. Centos7无网安装本地yum源

    目录 一. 前言 二.挂载centos7光盘映像文件 三.修改本地yum源 一. 前言 前段时间研究了一下abaqus在Linux系统上的安装,头痛了许久.关键是要装的电脑不能联网,导致许多依赖包不能 ...

  2. 制作基于http的yum源2

    yum源的创建脚本 #!/bin/bash # Title: yumcreate.sh # Author: cliang(gnome_dj@163.com) # Description: This i ...

  3. Centos7 本地IOS配置本地yum源

    1.上传ios镜像到机器(centos6就上传centos6的ios,centos7就上传centos7的镜像) 我机器是Centos7的,我把CentOS-7-x86_64-DVD-1708.iso ...

  4. 局域网内制作共享yum源

    一.为什么要制作共享yum源 首先,yum源使用起来很方便,安装软件yum一下就搞定,但是我们只能在连接互联网环境中才能使用yum,离线环境中,安装个软件又得折腾半天: 其次,搭建一个局域网/本地的y ...

  5. Centos搭建内网yum源

    Centos搭建内网yum源 手动创建repo文件 使用yum-config-manager配置yum源 安装yum-utils 手工指定yum源 将gpgcheck设置为0 Centos搭建内网yu ...

  6. 软件包管理及yum源环境搭建

    软件包管理 及yum源搭建 包管理器rpm 常见选项: -i 安装软件包 -v: 提供更多的详细输出 -h: 以#显示程序包管理执行进度 -test: 测试安装,但不真正执行安装,即dry run模式 ...

  7. linux yum安装分区工具,搭建本地和网络yum源、源码编译安装软件及磁盘分区管理...

    1.自建yum仓库,分别为网络源和本地源 1)挂载光盘镜像 [root@centos7 ~]#mount /dev/sr0 /mnt/ [root@centos7 ~]# df -h Filesyst ...

  8. yum详细教程(理解、使用、yum源)

    文章目录 对yum的简单理解 yum的使用方法 配置yum源国内镜像 对yum的简单理解 对安装软件这件事情的一个理解: 我们在安装软件时,必须要先把软件的安装包下载到本地: 在下载安装包之前,安装包 ...

  9. 局域网远程yum源制作

    局域网远程yum源制作 操作系统:centos7.4​资源: CentOS-7-x86_64-DVD-1708.iso镜像实验服务器两台:​192.168.246.170 (作为vsftpd服务端)​ ...

最新文章

  1. java循环制作万年历,java使用Calendar制作万年历
  2. 查看oracle自定义函数,Oracle自定义函数查询数据字典项
  3. 配置tomcat让shtml嵌套文件显示
  4. 程序员面试金典 - 面试题 10.03. 搜索旋转数组(二分查找)
  5. Git 少用 Pull 多用 Fetch 和 Merge
  6. Kubernetes学习总结(10)—— 何为云原生,与 kubernetes 是什么关系
  7. 绝对干货!纯用HTML+CSS+JS 编写的计算器应用
  8. 【转载】Linux 命令行快捷键 - 移动光标
  9. Linux 下配置 node + mongodb 环境
  10. 记一次生产环境存储过程优化的过程(42秒--0.06秒)
  11. List集合之CopyOnWriteArrayList
  12. USBCAN、CAN分析仪、CANCANFD综合测试分析软件LKMaster主要功能一览
  13. CS229 Lecture 12
  14. Apollo 的3D障碍物感知解析
  15. Android CPU 双核,骁龙MSM8625双核处理器
  16. 英伟达 Jetson Nano 新手必备:使用CSI或USB摄像头拍摄第一张照片
  17. The requested resource(/)is not available问题
  18. java小组坦克大战游戏开发文档开发日志_java实现坦克大战游戏
  19. 计算机会显示机械硬盘丢失,Win10机械硬盘突然消失,无法检测到解决方案
  20. 陈泽天 java_百余名“程序猿”捉对厮杀 600组“小分队”远程亮剑

热门文章

  1. mybatis源码分析(方法调用过程)
  2. HNUSTOJ-1437 无题
  3. 《云数据管理:挑战与机遇》2.3 数据库系统
  4. dubboSPI机制浅谈
  5. 公务员计算机考试题库,公务员考试题库
  6. 成为项目经理需要具备什么条件?
  7. 1.Dao代码如何编写?
  8. mysql期末考试试卷_mysql试题
  9. 手机整屏显示数据php,完美解决手机网页大背景不能铺完整个屏幕的超级代码
  10. python有哪些常用的package_个人Python常用Package及其安装