Linux install Yum source package and related operations

Source: Internet
Author: User

First, the use of the scene

Many times the downloaded RPM package does not meet our needs, or we need to use some of the features, we need to install the source code. Before source installation, first use Yum grouplist to confirm that the two groups of development tools and Server Platform development have been installed.

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s1.51cto.com/wyfs02/ M00/82/7b/wkiol1dwlkcqbb4caabrryymane459.png-wh_500x0-wm_3-wmp_4-s_2246193762.png "title=" 1.png "style=" float: none; "alt=" Wkiol1dwlkcqbb4caabrryymane459.png-wh_50 "/>

Second, the relevant knowledge detailed

1.make Tools

All programs require GCC to be compiled before they can be executed, the project's developers to simplify the user's compilation steps, then with the Make tool, make will call GCC to compile the program, so that makes is a project compiler tool, and the compilation itself needs the development environment, So you can explain why there must be two groups of development tools and Server Platform development, and that the compilation process also requires the ability to invoke the header and library files of the associated program, and the library file behaves as a xxxx-devl.rpm.

The process of generating 2.Makefile files

Open source Package We will see an executable file configure, while the package also has makefile.in files, through which they can generate makefile files, the following is a detailed description of the process.

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s1.51cto.com/wyfs02/ M00/82/7b/wkiol1dwlkdzcm6faad6cowdkjo179.png-wh_500x0-wm_3-wmp_4-s_2531161153.png "title=" 2.png "style=" float: none; "alt=" Wkiol1dwlkdzcm6faad6cowdkjo179.png-wh_50 "/>

(1) Generate Configure script

The creator of the project will use a AUTOCONF development tool that uses this development tool to generate a configure script for each of the original code in the project, using the script to check whether the compilation environment satisfies the requirements, defines which features are enabled at compile time, and the installation path.

(2) Generate Makefile.in file

The makefile.in file is generated by the Automake tool, and the Makefile file is generated in conjunction with the Configure script.

(3) Generate Makefile File

When the Configure script is executed, the Configure script generates makefile files based on the makefile.in file, while defining which features and installation paths are enabled at compile time are also saved in the file, which is also the configuration file when the Make command is used.

Third, installation steps

We take the installation of httpd-2.2.31 as an example to illustrate. The detailed steps are:

1. Download the source package and use TAR-XF httpd-2.2.31.tar.gz decompression

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s1.51cto.com/wyfs02/ M01/82/7c/wkiom1dwk5mbgoovaabovjopjxs356.png-wh_500x0-wm_3-wmp_4-s_3678280560.png "title=" 3.png "style=" float: none; "alt=" Wkiom1dwk5mbgoovaabovjopjxs356.png-wh_50 "/>

2. Use less install to view the installation steps (the documentation for each program is different, either read or install)

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s1.51cto.com/wyfs02/ M01/82/7b/wkiol1dwlkghkvkeaadfgmru3fq662.png-wh_500x0-wm_3-wmp_4-s_1252810404.png "title=" 4.png "style=" float: none; "alt=" Wkiol1dwlkghkvkeaadfgmru3fq662.png-wh_50 "/>

3. Use the./configure--help to view the Configure script using Help, as appropriate, as an example of a custom installation and configuration file location, using the./configure--prefix=/usr/local/apache-- Sysconfdir=/etc/apache checking the environment and generating makefile files

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s3.51cto.com/wyfs02/ M01/82/7c/wkiom1dwk5ryvmuhaacs5zm3hds276.png-wh_500x0-wm_3-wmp_4-s_1448871743.png "title=" 5.png "style=" float: none; "alt=" Wkiom1dwk5ryvmuhaacs5zm3hds276.png-wh_50 "/>

4. After checking to confirm that there is no error, enter make installation, at which time the make will call GCC to compile

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s3.51cto.com/wyfs02/ M02/82/7c/wkiom1dwk5ri0mpdaabpiekxwkq506.png-wh_500x0-wm_3-wmp_4-s_4249714205.png "title=" 6.png "style=" float: none; "alt=" Wkiom1dwk5ri0mpdaabpiekxwkq506.png-wh_50 "/>

5. Then install with the make install command, and wait for the installation to finish

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s3.51cto.com/wyfs02/ M01/82/7b/wkiol1dwlklqqosvaac6xt8cxi8401.png-wh_500x0-wm_3-wmp_4-s_1420731064.png "title=" 7.png "style=" float: none; "alt=" Wkiol1dwlklqqosvaac6xt8cxi8401.png-wh_50 "/>

6. Under/usr/local/apache/bin Path, start the service using Apachectl start

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s5.51cto.com/wyfs02/ M02/82/7c/wkiom1dwk5vr2x6eaacxumbzbpk161.png-wh_500x0-wm_3-wmp_4-s_2875572319.png "title=" 8.png "style=" float: none; "alt=" Wkiom1dwk5vr2x6eaacxumbzbpk161.png-wh_50 "/>

7. Use NETSTAT-NLT to see if 80 ports are listening

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s5.51cto.com/wyfs02/ M02/82/7b/wkiol1dwlkpj1i3naaa1wfdb04u593.png-wh_500x0-wm_3-wmp_4-s_1365744020.png "title=" 9.png "style=" float: none; "alt=" Wkiol1dwlkpj1i3naaa1wfdb04u593.png-wh_50 "/>

8. Open the browser, enter the server address to see the display it works! Configuration complete

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s2.51cto.com/wyfs02/ M00/82/7c/wkiom1dwk5vdkjhlaaabmos4fyk646.png-wh_500x0-wm_3-wmp_4-s_877766907.png "title=" 10.png "style=" float: none; "alt=" Wkiom1dwk5vdkjhlaaabmos4fyk646.png-wh_50 "/>

Iv. Next Steps

After the installation of the source package service is not finished after normal startup, we know that a program can be broadly divided into: binary programs, header files, library files, man help manual four parts, and we at the installation of the custom path system may not be automatically recognized, so we need to do output redirection.

1. Binary Program

Use vim/etc/profile.d/apache.sh to add/usr/local/apache/bin,/usr/local/apache/sbin to the default path and take effect on the child process

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s2.51cto.com/wyfs02/ M00/82/7b/wkiol1dwlkpysn4waaaowekamwi023.png-wh_500x0-wm_3-wmp_4-s_2043705165.png "title=" 11.png "style=" float: none; "alt=" Wkiol1dwlkpysn4waaaowekamwi023.png-wh_50 "/>

Then restart the server or use source/etc/profile.d/apache.sh to reread the configuration file, confirming that/usr/local/apache/bin,/usr/local/apache/sbin has been successfully added to the PATH variable

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s2.51cto.com/wyfs02/ M02/82/7b/wkiol1dwlkpgz7_haaaw6xfklzs187.png-wh_500x0-wm_3-wmp_4-s_1424091118.png "title=" 12.png "style=" float: none; "alt=" Wkiol1dwlkpgz7_haaaw6xfklzs187.png-wh_50 "/>

2. header file output

As for why the header file is to be output, because it is necessary to make a call when the program is developed two times, the invocation is different from the binary code (ABI) of the runtime Invoker, and the invocation of the development is the inclusion of the program header, and the header file includes information such as the entry of the function and the type of the pointer (API)

Create a soft connection using Ln-sv/usr/local/apache/include/usr/include/apache to jump Apache header files to/usr/local/apache/include

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s2.51cto.com/wyfs02/ M01/82/7c/wkiom1dwk5ygfinuaabmsp-fuac631.png-wh_500x0-wm_3-wmp_4-s_4240574199.png "title=" 13.png "style=" float: none; "alt=" Wkiom1dwk5ygfinuaabmsp-fuac631.png-wh_50 "/>

3. The number of library files

vim/etc/ld.so.conf.d/apache.conf, create a APACHE.COMF file,/usr/local/apache/lib write the library file path, if there are multiple libraries, one line

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s2.51cto.com/wyfs02/ M01/82/7b/wkiol1dwlktiy6g3aaatapxlp2i024.png-wh_500x0-wm_3-wmp_4-s_3693899990.png "title=" 14.png "style=" float: none; "alt=" Wkiol1dwlktiy6g3aaatapxlp2i024.png-wh_50 "/>

Then use LDCONFIG-V to see if the library file path is correctly identified

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s1.51cto.com/wyfs02/ M02/82/7c/wkiom1dwk52qoqfqaaachw-5plc350.png-wh_500x0-wm_3-wmp_4-s_150939093.png "title=" 15.png "style=" float: none; "alt=" Wkiom1dwk52qoqfqaaachw-5plc350.png-wh_50 "/>

4.man Document output

Using Vim/etc/man.config to add Apache's man file path under the Manpath path, this completes the operation

650) this.width=650; "src=" http://arkling.blog.51cto.com/e/u261/themes/default/images/spacer.gif "style=" border : 1px solid RGB (221,221,221); Background-image:url ("/e/u261/lang/zh-cn/images/localimage.png"); background-position : 50% 50%;background-repeat:no-repeat; "alt=" Spacer.gif "/>650" this.width=650; "src=" http://s1.51cto.com/wyfs02/ M02/82/7b/wkiol1dwlksgew2xaabd6xncjyo538.png-wh_500x0-wm_3-wmp_4-s_3673725784.png "title=" 16.png "style=" float: none; "alt=" Wkiol1dwlksgew2xaabd6xncjyo538.png-wh_50 "/>



This article from "Rabbit-like rabbit sen Broken" blog, please be sure to keep this source http://arkling.blog.51cto.com/2844506/1787062

Linux install Yum source package and related operations

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.