Source package installation process in Linux

A preparation for installation
1. Install the C language compiler
[root@localhost ~]# rpm -qa|grep gcc
libgcc-4.8.5-11.el7.x86_64
gcc-gfortran-4.8.5-11.el7.x86_64
gcc-c++-4.8.5-11.el7.x86_64
gcc-4.8.5-11.el7.x86_64
2. Download the source package
Download a source package: httpd-2.2.9.tar.gz
Copy the source package to the /root directory.
[root@localhost ~]# ls|grep http
httpd-2.2.9.tar.gz
3. The apache of the rpm package and the apache of the source package can be installed on the same machine at the same time.
Features of the source code package: open source, customized, and the local compilation efficiency is higher.
Features of rpm package: The manufacturer compiles it for you, and the execution efficiency on the machine is not necessarily high.
It is generally recommended to use the source code package, which is more efficient.
 
Two installation precautions
1. The recommended storage location for the source package: /usr/local/src/
2. Source installation location: /usr/local
3. How to determine the installation process error:
The installation process stopped
And the prompt of error, warning or no appears.
 
Three source package installation process
1. Download the source package
2. Unzip the downloaded source package
3. Enter the decompression directory
 
Four actual combat
1. Unzip the downloaded source package
[root@localhost ~]# tar -zxvf httpd-2.2.9.tar.gz
2. View the decompression results
[root@localhost ~]# ll |grep http
drwxr-xr-x. 11 501 games 4096 6月 11 2008 httpd-2.2.9
-rw-r - r--. 1 root 6396996 7 月 19 21:10 httpd-2.2.9.tar.gz
3. Enter the decompression directory
[root@localhost ~]# cd httpd-2.2.9/
[root@localhost httpd-2.2.9]#
4. ./configure software configuration and inspection
Define the required functional options
Check whether the system environment meets the installation requirements
Write the defined function options and detection system environment information into the Makefile file for subsequent editing
Note: Basically every source package has this command.
[root@localhost httpd-2.2.9]# ll |grep config
-rw-r--r--. 1 501 games 10943 11月 22 2004 config.layout
-rwxr-xr-x. 1 501 games 660990 6月 11 2008 configure
-rw-r--r--. 1 501 games 23300 June 10 2008 configure.in
[root@localhost httpd-2.2.9]# ./configure --prefix=/usr/local/apache2
......
config.status: creating build/rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating build/config_vars.sh
config.status: creating include/ap_config_auto.h
config.status: executing default commands
[root@localhost httpd-2.2.9]#
5. make compile
[root@localhost httpd-2.2.9]# make
make clean: In case of an error, execute this command.
6. make install compile and install
[root@localhost httpd-2.2.9]# make install
7. View the installation results
[root@localhost httpd-2.2.9]# cd /usr/local/apache2/
[root@localhost apache2]# ls
bin build cgi-bin conf error htdocs icons include logs man manual modules
8. Start the service
[root@localhost apache2]# /usr/local/apache2/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
9. The role of the INSTALL file
Installation Notes
[root@localhost httpd-2.2.9]# cat INSTALL
 
APACHE INSTALLATION OVERVIEW
 
Quick Start - Unix
------------------
 
For complete installation documentation, see [ht]docs/manual/install.html or
http://httpd.apache.org/docs/2.2/install.html
 
$ ./configure --prefix=PREFIX
$ make
$ make install
$ PREFIX/bin/apachectl start
10 Verification


 
11 Uninstall the source package
There is no need to uninstall the command, just delete the installation directory. No junk files are left behind.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326154633&siteId=291194637