Build Yum source server based on HTTP

Source: Internet
Author: User
Tags gpg
Build Yum source server based on HTTP (11:59:14) Reprinted token
Label: Yum Linux lnmp lamp HTTP Category: Linux

To make it easier for the company to download, install, and upgrade software packages on more than 80 Linux servers and ensure version consistency, we recently installed a yum source in the idc lan;

The yum source is based on HTTP, and FTP can also be used. Here we only configure HTTP; below:

Build a yum server, download fast, and install software conveniently. the following operating environment is centos 5.4 i386 32bit, which is installed using HTTP.

1. install necessary software: (the Server IP address is 33.11.22.44)

 
# Yum install httpd createrepo // apache service and XML generation tool under rpeo

2. Copy related files:

 

 
   mkdir -p /data/yum.repo/centos/5/os/i386/RPMS 
   mkdir -p /data/yum.repo/centos/5/updates 
   mkdir -p /data/yum.repo/tools/ 
   mkdir /mnt/cdrom mount -t iso9660 /dev/cdrom /mnt/cdrom 
   cp -R /mnt/cdrom/CentOS/* /data/yum.repo/centos/5/os/i386/RPMS/ 
   cp -R /mnt/cdrom/repodata /data/yum.repo/centos/5/os/i386/ 
   cp -R /mnt/cdrom/RPM-GPG-KEY-CentOS-5 /data/yum.repo/   
// Copy other packages to/data/yum. repo/tools. You can add the desired RPM package, such as JDK

3. Start the HTTP service:

 
   #rm -rf /var/www/html 
   #ln -s /data/yum.repo /var/www/html service httpd start

4. Modify the repo file on the client:

 
   #cd /etc/yum.repo/   
   #vi CentOS-Base.repo   
       [base] 
       name=CentOS-$releasever - Base     
       baseurl=http://192.168.1.171/centos/$releasever/os/$basearch/ gpgcheck=1
       enabled=1 
       gpgkey=http://192.168.1.171/RPM-GPG-KEY-CentOS-5   
   
       #released updates 
       [updates] 
       name=CentOS-$releasever - Updates 
       baseurl=http://33.11.22.44/centos/$releasever/updates/ 
       gpgcheck=1
       enabled=1
       gpgkey=http://33.11.22.44/RPM-GPG-KEY-CentOS-5    
Save and exit
   vi CentOS-Tools.repo   
       [tools] name=CentOS-$releasever - Base 
       baseurl=http://192.168.1.171/tools/ gpgcheck=0
       enabled=1
Save and exit

5. Additional content

After the above steps are completed, you need to use the yum machine/etc/yum. the files in the repo directory are changed in Step 4. You can use the Yum and Yum commands here. add several common commands for the yum Server:

 
Createrepo/APP/yum. repo/centos/5/OS/x86_64 // update or create a home directory file index
Createrepo/APP/yum. repo/centos/5/updates/x86_64 // update or create a directory file index
Createrepo/APP/yum. repo/tools // update or create an index for the tools directory file
createrepo -g /mnt/cdrom/repodata/comps.xml /var/www/html/yum.repo/centos/5/updates/x86_64/ createrepo -g /mnt/cdrom/repodata/comps.xml /var/www/html/yum.repo/centos/5/os/x86_64/ 
// Update or create an index for the yum group. For example, Admin Tools contains multiple RPMs. You can use Yum grouplist to view the index.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.