- 服务器:提供软件仓库的服务,提供网络服务。
- 客户端:与服务端要在同一个网络内,能够访问服务器,需要配置自己的yum源的配置文件。
准备服务器:service httpd status #查看httpd状态,发现不存在这个服务。所以要先安装安装httpd服务。
安装httpd服务
- yum list | grep httpd ##查找
- yum -y install httpd.x86_64 ##安装http服务
- 测试:
service httpd start
浏览器页面访问192.168.91.3
把httpd设置为开机自启:chkconfig httpd on
准备软件包
将软件包放入http服务的根目录 /var/www/html
- 创建一个挂载点 mkdir /mnt/centos
- 将镜像文件挂载到挂载点 mount -t iso9660 -o loop /dev/cdrom /mnt/centos
- 将软件包拷贝到/var/www/html/centos中
ln -s /mnt/centos /var/www/html ##软连接到http服务的根目录中
配置局域网的yum源配置文件
- cd /etc/yum.repos.d
- rename .repo .repo.bak ./*
- cp CentOS-Base.repo.bak innet.repo
- vi innet.repo
配置成这样
[innet] | |
---|---|
name=innet | |
baseurl=http://hadoop01/centos | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 |
- yum clean all
- yum repolist
出现这样的结果:
repo id | repo name |
---|---|
status | |
innet | innet |
6,575 | |
repolist: 6,575 |