linux搭建http源【服务端和客户端详细说明】

inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

[root@master ~]#

关闭防火墙和selinux


  • firewall的话,直接systemctl stop firewalld即可

如果使用的是iptables,则吧firewalld替换成iptables

[root@master ~]# systemctl is-active firewalld

active

[root@master ~]#

[root@master ~]# systemctl stop firewalld

[root@master ~]#

[root@master ~]# systemctl is-active firewalld

inactive

[root@master ~]#

  • selinux关闭:setenforce 0

使用getenforce查看结果为Disabled才行。

[root@master ~]#

[root@master ~]# getenforce

Disabled

[root@master ~]#

[root@master ~]# #setenforce 0

[root@master ~]#

配置http服务


  • 我们需要安装http服务,所以我们需要先搭建一个本地源

下面我简单说下过程【照着我的做就行】,如果有不能理解的,去我博客中翻翻yum源的搭建,学习一下

#先创建一个文件用来挂载镜像

[root@master ~]# #mkdir /root/centos7.6

挂载镜像到刚才创建的那个文件

[root@master ~]# #mount CentOS-7.6-x86_64-DVD-1810.iso /root/centos7.6/

配置文件如下

[root@master ~]# cat /etc/yum.repos.d/centos.repo

[cenot-7.6]

name=cenots7.6

baseurl=file:///root/centos7.6

gpgcheck=0

enable=1

[root@master ~]#

正常情况直接执行这个命令就可以看到镜像数量了,如果为0,则执行一下:yum clean all

[root@master ~]# yum repolist

Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos,
subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast

Determining fastest mirrors

repo id repo name status

!cenot-7.6 cenots7.6 4,021

repolist: 4,021

[root@master ~]#

  • 安装httpd服务

yum install -y httpd

[root@master ~]# yum install -y httpd

Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos,
subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

cenot-7.6 | 3.6 kB 00:00

Resolving Dependencies

–> Running transaction check

—> Package httpd.x86_64 0:2.4.6-88.el7.centos will be installed

–> Processing Dependency: httpd-tools = 2.4.6-88.el7.centos for package: httpd-2.4.6-88.el7.centos.x86_64

–> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-88.el7.centos.x86_64

–> Processing

  • 9
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值