8.23_linux Package Management Compiler package Installation

Source: Internet
Author: User

Package compilation

Package Compilation Installation:

Application-version-release.src.rpm-->

After installation, use the Rpmbuild command to make the RPM package in binary format before installing

Source code----preprocessing----compile (GCC)------Execute

Source Code organization format:

Multiple files: Between the code in the file, there is likely to be a cross-file dependency

C, C++:make (project Manager, configure-->makefile.in---Makefile)

Java:maven


Compiling the installation

C Code compilation installation three steps:

1,./configure:

(1) Pass the parameter through the option, specify enable feature, install path, etc., refer to User's designation and makefile.in file generation makefile when executing

(2) Check the dependent external environment

2. Make: Build the application according to the makefile file

3. Make install: Copy files to the appropriate path

Development tools:

AUTOCONF: Generate Configure Script

Automake: Generate makefile.in

Note: See Install,readme before installing


Source code acquisition of open source program:

Official self-built site:

Apache.org (ASF)

mariadb.org

...

Code hosting:

SourceForge.net

Github.com

Code.google.com

C + + compiler: gcc (GNU c complier)


Compile C source code:

Premise: Provide development tools and development environment

Development tools: Make, GCC, etc.

Development environment: Development Library, header file

GLIBC: Standard Library

To provide development components through "package groups"

CentOS 7: "Development Tools",

"Server Platform Development",


First step: Run the Configure script

Options: Specify the installation location, specify the enabled features

--help: Get the options it supports

Option Categories:

Installation path settings:

--prefix=/path: Specifies the default installation location, which defaults to/usr/local/

--sysconfdir=/path: Configuration File Installation Location

System Types: cross-compilation supported

Optional Features: Optional Features

--disable-feature

--enable-feature[=arg]

Optional Packages: Optional Package,

--WITH-PACKAGE[=ARG], dependent packages

--without-package, disabling dependencies

Step Two: Make

Step Three: Make install


Post-installation configuration:

(1) The binary program directory is imported into the PATH environment variable;

Edit File/etc/profile.d/name.sh

Export Path=/path/to/bin: $PATH

(2) Import library file path

Edit/etc/ld.so.conf.d/name.conf

Add a new library file in the same directory as this file;

To have the system regenerate the cache:

LDCONFIG[-V]

(3) Import header file

Implemented in a link-based manner:

Ln-sv

(4) Import help manual

Edit/etc/man.config|man_db.conf File

Add a Manpath


Example: Source Installation Apache

To install Apache, you need to install the development of the package group first TOOLSS

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86/64/wKiom1e9ePiTSOHSAAALc3In-3c432.png "title=" 101. PNG "alt=" Wkiom1e9epitsohsaaalc3in-3c432.png "style=" float:none; "/>

Grouplist command to view a package group that has already been installed

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/86/63/wKioL1e9ePiyFFLYAAB2F69z8iY895.png "title=" 102. PNG "alt=" Wkiol1e9epiyfflyaab2f69z8iy895.png "style=" float:none; "/>

Next, we need to download Apache corresponding files, we first install the LFTP command, the default is not installed

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/63/wKioL1e9abmxE-WdAABTDZnlTac811.png "title=" 64.png "alt=" Wkiol1e9abmxe-wdaabtdznltac811.png "style=" Float:none;/>

Apache compressed package can be downloaded to apache.org official website, here we use the classroom resources to find the package can be installed

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/63/wKiom1e9abmzqmOJAACEaxtRudw053.png "title=" 65.png "alt=" Wkiom1e9abmzqmojaaceaxtrudw053.png "style=" Float:none;/>

Find the httpd-2.2.29 package for the number of experiments, and download the current directory to the system with the GET command

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/63/wKioL1e9abriEi45AADuCLAwtoc189.png "title=" 66.png "alt=" Wkiol1e9abriei45aaduclawtoc189.png "style=" Float:none;/>

View the path of the package, and then unzip

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86/63/wKiom1e9abqyKXGsAAAfgHsIYnY542.png "title=" 67.png "alt=" Wkiom1e9abqykxgsaaafghsiyny542.png "style=" Float:none;/>

The default is also extracted to the current path

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/63/wKioL1e9abvjhmS_AAAY3x79900204.png "title=" 68.png "alt=" Wkiol1e9abvjhms_aaay3x79900204.png "style=" Float:none;/>

CD into the httpd directory inside, first we have to look at the installation instructions, this is necessary to see, or else it is not clear that the situation is not good

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/86/63/wKiom1e9abyCYQD3AAAM0ZIPTu8724.png "title=" 71.png "alt=" Wkiom1e9abycyqd3aaam0ziptu8724.png "style=" Float:none;/>

Review the installation instructions and confirm some basic information

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86/63/wKiom1e9abuxVNCiAAD2PYdQR2k092.png "title=" 69.png "alt=" Wkiom1e9abuxvnciaad2pydqr2k092.png "style=" Float:none;/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/86/63/wKioL1e9abzDKrR3AACRhJS_vAo144.png "title=" 70.png "alt=" Wkiol1e9abzdkrr3aacrhjs_vao144.png "style=" Float:none;/>

And look at the documentation.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/86/63/wKioL1e9abzDJd9iAAAKTAI7G3w230.png "title=" 72.png "alt=" Wkiol1e9abzdjd9iaaaktai7g3w230.png "style=" Float:none;/>

In the documentation, we'll probably introduce the package.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/86/63/wKiom1e9ab2i7HrEAACdfSzU3s0953.png "title=" 73.png "alt=" Wkiom1e9ab2i7hreaacdfszu3s0953.png "style=" Float:none;/>

After reading the documentation, do not worry about the installation, first look at some details of the Configure script description

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/86/63/wKiom1e9ab7xujddAACcPJ_6vbk338.png "title=" 74.png "alt=" Wkiom1e9ab7xujddaaccpj_6vbk338.png "style=" Float:none;/>

For example, here is the default installation directory of the software, if you do not see, maybe we do not know where to put the file

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/63/wKioL1e9ab7RQgujAAA4edeZ1OU036.png "title=" 75.png "alt=" Wkiol1e9ab7rqgujaaa4edez1ou036.png "style=" Float:none;/>

Look at other key files, such as program binaries and library files, and so on, here are some hints for adding environment variables, etc.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/86/63/wKioL1e9ab-RRiy5AABIDtjL04I755.png "title=" 76.png "alt=" Wkiol1e9ab-rriy5aabidtjl04i755.png "style=" Float:none;/>

Check the system installation key directory, as well as the directory description, when the installation, the location of these directories we also replaced the custom directory location

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/86/64/wKiom1e9fZHR286tAADHlLm0NXI592.png "title=" 103. PNG "alt=" Wkiom1e9fzhr286taadhllm0nxi592.png "/> Supports cross-compilation lifetimes

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/86/63/wKioL1e9acDSrjYwAAAvV5C1Y08422.png "title=" 78.png "alt=" Wkiol1e9acdsrjywaaavv5c1y08422.png "style=" Float:none;/>

There are many other functional switches that need to be seen if needed.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/63/wKiom1e9acCBWelZAACE7745st0983.png "title=" 79.png "alt=" Wkiom1e9accbwelzaace7745st0983.png "style=" Float:none;/>

Start the first step of running the script for installation, first of all configure a series of installation files

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/63/wKiom1e9acCSngMmAABKDwSoXaE513.png "title=" 80.png "alt=" Wkiom1e9accsngmmaabkdwsoxae513.png "style=" Float:none;/>

The script runs out of a bunch of configuration files

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/63/wKioL1e9f9nAfa5yAADQvfNCFsc309.png "title=" 104. PNG "alt=" Wkiol1e9f9nafa5yaadqvfncfsc309.png "/> Run make to start compiling

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/63/wKioL1e9acGwG9hCAAAIJKp0slk648.png "title=" 82.png "alt=" Wkiol1e9acgwg9hcaaaijkp0slk648.png "style=" Float:none;/>

We can view the/usr/local directory below and found no HTTP2 file. Because you haven't started the installation yet.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/63/wKiom1e9acKA-i2dAABjqkcoNKo126.png "title=" 83.png "alt=" Wkiom1e9acka-i2daabjqkconko126.png "style=" Float:none;/>

Run make install to install the generated installation files

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86/63/wKioL1e9acKRJuSJAADF5oLCFMg237.png "title=" 84.png "alt=" Wkiol1e9ackrjusjaadf5olcfmg237.png "style=" Float:none;/>

At this time we go in the installation directory, look at the installed files, because the first installation, do not know how to use, this time of course is the query Help manual, but we found no help manual, do not panic, because the system does not query the path of the Help file

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/63/wKiom1e9acPxaLypAAB6ZoL5P70804.png "title=" 85.png "alt=" Wkiom1e9acpxalypaab6zol5p70804.png "style=" Float:none;/>

The/etc/man_db.conf file is edited under CentOS 7. In the location plus the Help file path of the Apache after installation

If it is CentOS 6, the path to the Help file will be in/etc/man.config

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/63/wKiom1e9acPijyV_AACtODggUTg600.png "title=" 86.png "alt=" Wkiom1e9acpijyv_aactodggutg600.png "style=" Float:none;/>

You can now view the APACHECTL's manual.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/63/wKioL1e9acTT-Lx1AAAbnU5CQso626.png "title=" 87.png "alt=" Wkiol1e9actt-lx1aaabnu5cqso626.png "style=" Float:none;/>

To facilitate our direct operation of Apache commands, we import the Apache package bin directory into the $path

Create a http2.sh script under/etc/profile.d/, then run the script and see if the $path variable is correct at this time. The script information is as shown. 650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/63/wKiom1e9acSABWA2AABCefx-mJ4446.png "title=" 89.png "alt=" Wkiom1e9acsabwa2aabcefx-mj4446.png "style=" Float:none;/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/86/63/wKioL1e9acShRFg-AAAKZmn1_zA339.png "title=" 88.png "alt=" Wkiol1e9acshrfg-aaakzmn1_za339.png "style=" Float:none;/>

At this point we write the path configuration of the Apache library file to the/etc/ld.so.conf.d/directory, and create a http2.conf script that is the path to the Apache Lib, as shown in.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/63/wKioL1e9acWB8lTqAACfsfj9_tE398.png "title=" 90.png "alt=" Wkiol1e9acwb8ltqaacfsfj9_te398.png "style=" Float:none;/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86/63/wKiom1e9acXBrUfVAAAFm895OmY922.png "title=" 91.png "alt=" Wkiom1e9acxbrufvaaafm895omy922.png "style=" Float:none;/>

When the configuration file for the library file is written, run the LDCONFIG-V command to load the library file into memory

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86/63/wKiom1e9acXCRoDiAACTDiZdvdg448.png "title=" 92.png "alt=" Wkiom1e9acxcrodiaactdizdvdg448.png "style=" Float:none;/>

Next, create a soft-link directory of the header file to the system's/usr/include/directory.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/86/63/wKioL1e9acXiuylVAAA_vbR8Ar4965.png "title=" 93.png "alt=" Wkiol1e9acxiuylvaaa_vbr8ar4965.png "style=" Float:none;/>

To configure the test, create a simple index.html file here under the Apache directory

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/86/64/wKiom1e9gnHxRtUoAAANtF2eJDw475.png "title=" 100. PNG "alt=" Wkiom1e9gnhxrtuoaaantf2ejdw475.png "style=" float:none; "/>

The above are ready, we can start running Apache server, will find that there are two lines of error, these two errors in this environment is not a problem, because the current environment also has to configure the Web server DNS and IP information

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/86/64/wKiom1e9gnCDAhJQAAAecLZLnUU084.png "title=" 98.png "alt=" Wkiom1e9gncdahjqaaaeclzlnuu084.png "style=" Float:none;/>

After starting the Apacche service, we use another server link test to see

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/86/63/wKioL1e9acbSUZYwAAAI7GCcunY161.png "title=" 94.png "alt=" Wkiol1e9acbsuzywaaai7gccuny161.png "style=" Float:none;/>

Normally it should be normal operation here, if you find an error, the wrong way to see if there is a problem

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/86/63/wKiom1e9acaholAXAAAacT-K7B0185.png "title=" 95.png "alt=" Wkiom1e9acaholaxaaaact-k7b0185.png "style=" Float:none;/>

At this point, look at the Apache port, found that the port number 80 is open, should httpd service has been opened

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/86/64/wKioL1e9lJKBlDU4AABxtqg__us878.png "title=" 106. PNG "alt=" wkiol1e9ljkbldu4aabxtqg__us878.png "/> Test the connectivity of 10.1.156.72, find that you can ping it, and then run Telnet 10.1.156.72 to the Apache server, found that the link is not, it may be a firewall problem.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/64/wKiom1e9gm7wNqz3AABoMn-1h2w439.png "title=" 96.png "alt=" Wkiom1e9gm7wnqz3aabomn-1h2w439.png "style=" Float:none;/>

Log on to the Apache server and empty the information inside the iptables.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/86/64/wKioL1e9gm_AIU9NAAALgNNKEes975.png "title=" 97.png "alt=" Wkiol1e9gm_aiu9naaalgnnkees975.png "style=" Float:none;/>

Re-run the links 10.1.156.72 on the 156.68 machine and find it possible to log in


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/86/64/wKioL1e9gnDza88zAAAVUQ1qc6w273.png "title=" 99.png "alt=" Wkiol1e9gndza88zaaavuq1qc6w273.png "style=" Float:none;/>

In the browser above the computer test, there is no problem, to the experiment has been completed here.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/86/64/wKioL1e9hVryOFgUAAAdF_C9Bdc626.png "title=" 105. PNG "alt=" Wkiol1e9hvryofguaaadf_c9bdc626.png "/>


This article is from the "~ Breeze ~" blog, please be sure to keep this source http://wanweifeng.blog.51cto.com/1957995/1842614

8.23_linux Package Management Compiler package Installation

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.