[toc]
1 . 本地YUM源配置
- 關(guān)閉iptables :
service iptables stop
- 配置iptables不開機(jī)啟動 :
chkconfig iptables off
- 掛載光盤 :
mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom/
- 設(shè)置開機(jī)自動掛載:
vi /etc/fstab
#添加以下內(nèi)容
/dev/cdrom /mnt/cdrom iso9660 defaults 0 0
- 創(chuàng)建光盤軟鏈接 :
ln -s /mnt/cdrom /var/www/html/centos
- 重命名其他yum源:
cd /etc/yum.repos.d/&& rename .repo .repo.bak *
#為了測試方便,避免其他YUM源的干擾 - 拷貝一個(gè)yum源配置文件 :
cp /etc/yum.repos.d/CentOS-local.repo /etc/yum.repos.d/CentOS-http.repo
8.修改yum源配置文件 :vi /etc/yum.repos.d/CentOS-http.repo
[c6-local]
name=CentOS-$releasever - local
baseurl=file:///mnt/cdrom
gpgcheck=0
enabled=1
- 清除yum源緩存:
yum clean all
- 查看yum源:
yum repo list
2 . yum網(wǎng)絡(luò)版?zhèn)}庫配置
-
關(guān)閉防火墻 :
centos 6.x :
service iptables stop
centos 7.x :
systemctl stop firewalld.service
配置防火墻不開機(jī)啟動 :
centos 6.x :
[root@localhost ~]# chkconfig iptables off
centos 7.x :[root@localhost ~]# systemctl disable firewalld.service
安裝httpd服務(wù)(可先配置本地yum源,用于安裝服務(wù)) :
yum install httpd
開啟httpd服務(wù) :
service httpd start
設(shè)置httpd開機(jī)啟動 :
chkconfig httpd on
驗(yàn)證apache服務(wù)器正常:在瀏覽器上輸入本地的ip地址
掛載光盤 :
mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom/
設(shè)置開機(jī)自動掛載:
vi /etc/fstab
#添加以下內(nèi)容
/dev/cdrom /mnt/cdrom iso9660 defaults 0 0
- 創(chuàng)建光盤軟鏈接 :
ln -s /mnt/cdrom /var/www/html/centos
- 重命名其他yum源:
cd /etc/yum.repos.d/&& rename .repo .repo.bak *
#為了測試方便烙常,避免其他YUM源的干擾 - 拷貝一個(gè)yum源配置文件 :
cp /etc/yum.repos.d/CentOS-local.repo /etc/yum.repos.d/CentOS-http.repo
11.修改yum源配置文件 :vi /etc/yum.repos.d/CentOS-http.repo
[c6-http]
name=CentOS-$releasever - http
baseurl=http://192.168.6.100/centos
gpgcheck=0
enabled=1
- 拷貝到局域網(wǎng)其他節(jié)點(diǎn) :
sudo scp /etc/yum.repos.d/CentOS-http.repo username@host:/etc/yum.repos.d/
- 清除yum源緩存:
yum clean all
- 查看yum源:
yum repolist