Httpd self-built Yum installation Source

Source: Internet
Author: User
Tags gpg

Tutorial topology:

---------------------------------------------------------

| Server IP: 192.168.1.100 | <------- bridge --------> | Client IP: 192.168.1.101 |

---------------------------------------------------------

Ideas:

1. [server] confirm httpd Installation

12 rpm -q httpdhttpd-2.2.15-29.el6.centos.i686

If not, install

2.[Server]Copy the package file to the webpage file directory

1 cp /media/cdrom/Packages//var/www/html/Packages/

Here, I have created a packages file under the webpage file directory to store RPM package files.

It was copied from the CD image.

3.[Server]Create the repository file createrepo/path

1 createrepo /var/www/html/Packages/ # Create the source data file of the package file in this file

In this way, the RMP package server is ready. Now we can download and test it.

4. [client] modify the yum configuration file

Open another virtual machine. Of course, the two machines must first be connected to the Internet.

12345 ping 192.168.1.100PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.64 bytes from 192.168.1.100: icmp_seq=1 ttl=64 time=2.57 ms64 bytes from 192.168.1.100: icmp_seq=2 ttl=64 time=0.396 ms64 bytes from 192.168.1.100: icmp_seq=3 ttl=64 time=0.400 ms

Yum repo configuration file path:

 

Specify the available Yum repository/etc/yum. conf,/etc/yum. Repo. d/*. Repo
Configuration File Format: consists of two segments, similar to the Windows ini configuration file
[Main]: Main configuration segment
[Repo]: Repository configuration section

Structure of the yum repo configuration file:

1234567 [reop_ID] # Note that the repo_id must not be the same as the ID in other configuration files.name=String # Repository namebaseurl=http://server/path/to/repo # Repository access path. For more information, see server access method:enabled={1|0} # Whether to enable this repository, which is enabled by defaultgpgcheck={1|0} # Check the package source validity and integritygpgkey= # When GPG detects the public key file path, it can be local or on the server.cost= # Define the overhead of this repository. The default value is 1000. The smaller the value, the higher the priority.

 

OK! Ping, start configuring the client's yum repo configuration file, set each repository in the CentOS-Base.repo to Enabled = 0, so that we do not use the default repository, if there is no enabled project under [base], we can manually add enabled = 0.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 vim /etc/yum.repos.d/CentOS-Base.repo# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client.  You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.## [base]name=CentOS-$releasever - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6enabled=0 # Note that this parameter is set to 0.#released updates [updates]name=CentOS-$releasever - Updatesmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6enabled=0 # Note that this parameter is set to 0.#additional packages that may be useful[extras]name=CentOS-$releasever - Extrasmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6enabled=0 # Note that this parameter is set to 0.#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plusmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0 # Note that this parameter is set to 0.gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users[contrib]name=CentOS-$releasever - Contribmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/gpgcheck=1enabled=0 # Note that this parameter is set to 0.gpgkey=:wq # Released after savingvim /etc/yum.repos.d/Httpd-test-Base.repo # Configure a repo configuration file as follows:[httpd-192.168.1.100]name=testenabled=1baseurl=http://192.168.1.100/Packages/gpgcheck=0:wq # Save and exit yum repolist # Let's take a look at the repo list of yum. If the output result is similar to the following, you can set a repo.Loaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfilerepo idrepo name                          statushttpd-192.168.1.100                               test2,695repolist: 2,695

 

 

5. [client] installation and testing

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 yum install httpdLoaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfileSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package httpd.i686 0:2.2.15-29.el6.centos will be installed--> Finished Dependency Resolution Dependencies Resolved ==================================================================== Package       Arch         Version                      Repository ====================================================================Installing: httpd         i686         2.2.15-29.el6.centos         httpd-192.1 Transaction Summary====================================================================Install       1 Package(s) Total download size: 828 kInstalled size: 2.8 MIs this ok [y/N]: ^CExiting on user Command[[email protected] yum.repos.d]# yum install httpdLoaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfileSetting up Install ProcessResolving Dependencies--> Running transaction check---> Package httpd.i686 0:2.2.15-29.el6.centos will be installed--> Finished Dependency Resolution Dependencies Resolved ==================================================================== Package Arch   Version                 Repository             Size====================================================================Installing: httpd   i686   2.2.15-29.el6.centos    httpd-192.168.1.100   828 k Transaction Summary====================================================================Install       1 Package(s) Total download size: 828 kInstalled size: 2.8 MIs this ok [y/N]: yDownloading Packages:httpd-2.2.15-29.el6.centos.i686.rpm          | 828 kB     00:00     Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionWarning: RPMDB altered outside of yum.  Installing : httpd-2.2.15-29.el6.centos.i686                  1/1   Verifying  : httpd-2.2.15-29.el6.centos.i686                  1/1Installed:  httpd.i686 0:2.2.15-29.el6.centos                                  Complete!

It's hard

Httpd self-built Yum installation Source

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.