yum安裝的四種方式
一、默認:從國外下載
二、國內:從阿里獲取 http://mirrors.aliyun.com



三、本地文件:從本地搭建一個源頭(repository)
四、本地服務:http://ip/
這里用的是本地文件的方式
4.1、安裝Nginx
略。。
4.2、修改nginx.conf配置文件
vi /usr/local/nginx/conf/nginx.conf
修改
Location 中
Root /mnt
Autoindex on
4.3、掛載到mnt
這里需要注意鏡像需要大的iso文件4G的那個,注意開機前連接到這個4G鏡像
cd /dev
mount /dev/cdrom /mnt
ls /mnt
umount /mnt
4.4、啟動Nginx
Service nginx start
Chkconfig nginx on 設置開機啟動
注意防火牆要關閉
Service iptables stop
Chkconfig iptables off
這時候在瀏覽器輸入nginx所在node的節點的ip,可訪問nginx , 查看是否掛載成功
4.5、yum源配置文件
在其他node獲得source源
Vi /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-local
baseurl=http://具體yum源服務器的ip地址
gpgcheck=0
Yum install man -y 拔掉網線測試,是否能夠成功