stay 《Linux And CentOS Local repository (yum Source ) Configuration of 》 In the blog of , Xiaojun introduced to you how to CentOS Make local yum Source , I believe you have mastered . But have you ever thought about such a problem : If there is a cluster now , share 100 Computers , Every computer needs to be configured yum Source , Do we have to configure local yum Source 100 Time ? ha-ha , It doesn't need to be that much trouble , We only need to configure it once on one computer , And then let other virtual machines connect to this one as " The host machine " Our computer , You can use it together yum Source ~ Do you think it's amazing , Next, Xiaojun will teach you how to operate (￣▽￣)*
① install httpd
yum -y install httpd
② start-up httpd service
service httpd start
③ test Open the browser , Enter... In the address field
http://192.168.100.111:80( My own virtual machine ip) Open the interface as shown in the figure below , shows httpd The service started successfully
④ expand :
service iptables stop
# take iso Copy the path of the source to the specified path cp -r /mnt/cdrom/* /var/www/html/CentOS-6.9
192.168.100.111/CentOS-6.9, We can find that the success of the original local yum The source files are put on the local area network !
# Backup default yum Source cd /etc/yum.repos.d/ mv local.repo local.repo.bak # Make local yum Source 【 Set... On all other virtual machines 】 cd /etc/yum.repos.d/ vi CentOS-Local.repo Fill in the following ： [base] name=CentOS-Local baseurl=http://192.168.100.111/CentOS-6.9/ gpgcheck=0 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Make lan yum Source needs to be downloaded first httpd service , utilize httpd Put a server's yum Source files uploaded to the LAN , So that other servers in the same LAN can be connected , Each server needs to be configured locally yum Source of trouble . That's all for this sharing , If you have any questions or good suggestions, please leave a message in the comments section , If you like, please pay attention to it ~~
Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .