Install Redhat Linux source code

Source: Internet
Author: User

The source code is the text written in a specific language, such as the common C language. However, the installation of the source code requires a series of complex processes to be configured and compiled, so why do you need to install the source code? In fact, this is to allow our system to use updated features and more features. In addition, we can also customize our configurations. Take apache for example. RedHat officially provides us with version 2.2, but the latest version has reached version 2.4, so sometimes we need to install the source code.

The following is a brief introduction of the essential environment for source code installation:

The source code needs to be compiled into an executable file, while the compilation requires a corresponding compiling environment. When four software groups are installed in our system: Develepment Tools, Develepment Libraries, legacy software, and X soft Develepment, our compilation environment is basically ready.

Recommended reading:

StarDict pronunciation setting in Ubuntu 12.04

Install Stardict

Install starnet translation (StarDict-3.0.1) in openSUSE)

We take software httpd-2.4 as an example for everyone to explain, the following began the installation of source code:

Step 1: disassemble httpd and put it in the specified directory/usr/local/src

Switch to the location where the source code is disassembled, and enter the corresponding httpd directory under this directory. Some feature files, such as configure (to generate makefile files), INSTALL, or README (to guide us to INSTALL) are included ). View the INSTALL file, as shown below:

Step 2: generate the makefile file

But we won't be so easy to install. We will find various problems during the installation process. Let's solve them one by one.

(1) generate the makefile file of httpd

Then, check whether the system has installed apr.

As a result, we found that apr was installed. What is the problem? In this case, we should first consider the lack of required libraries in apr, which are often placed in devel. Then we will install the apr-devel software package.

(2) the following error occurs again after you install apr-devel.

The prompt is that the apr version is too low, at least 1.4.0. If you go to the Internet to find a higher version, you must note that we need to find the source code suitable for our system platform, as shown in. Generally, i386, i586, and i686 platforms are used, however, if you are a 64-bit user, you need to select x86_64.

Start to install the source code of apr. We need to install both apr and apr-util. util is a tool to separate the two software packages.

In this case, under the/usr/local/apr/apr1-1.4.6 directory, execute make to compile

Finally, execute make install for installation.

(3) the following files are generated in the/usr/local/apr directory after installation.

However, if these library files and header files are to be used by others, some processing is required:

[Header file processing] enter the directory/usr/include that can be recognized by the system, then create a link to the directory ln-s/usr/local/apr/include/apr-1/* For the header file of apr /*.

[Database File Processing] At/etc/ld. so. conf. d directory to create the name apr. conf file and edit it. Enter the path/usr/local/apr/lib for the system to find the library file. Save the file and exit. Then, ldconfig reloads the cache and views it. As shown in, the library file can be found.

(4) At This Point, apr has been installed, and apr-util is installed based on apr. the following error occurs when the makefile file is generated, the prompt we haven't found apr. Let's add a -- with-apr option.

It should be noted that during the source code installation process, we should learn to use the command to solve the problem for us and view the relevant information.

To the/usr/local/apr directory, use the tree Command to display the relationship between files. The result shows that the file exists in the bin directory.

Then generate the makefile file. Note that you need to add the directory to the file.

Then make and install util, because util is a tool, there is no need to manage header files and library files, so the apr problem is solved here.

(5) then proceed to the first step, but there is a problem, prompting us that the configuration file is missing and we need to specify the apr configuration file

Add the path of the apr configuration file to step 1.

However, a similar problem occurs again, prompting us that the apr-util configuration file is not found, then we can add -- with-apr-util =/uar/local/apr-util/to the above command, and some minor problems occur, that is, the pcre Library cannot be found.

After the previous configuration, we can guess that the pcre-devel package is not installed, so we can install pcre-devel.

After the installation is complete, generate the makefile file of httpd. this time there is no problem. The installation process is hard, but don't be discouraged. The effort and return are relative!

For details, see page 2nd:

  • 1
  • 2
  • Next Page

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.