Source code compilation overview
■Advantages of using source code to install software
●Obtain the latest software version and fix bugs in time
●Customize software functions flexibly according to user needs
■Application examples
●When installing a newer version of the application
●When the currently installed program cannot meet the
needs When adding new features to the application
■Tarball packet
●.tar.gz and .tar.bz2 formats are mostly
●Software material reference: http://sourceforge.net
■Integrity check
●md5sum check tool
[root@localhost ~]# md5sum httpd-2.4.25.tar.gz
24fb8b9e36cf131d7 8caae864fea0f6a httpd-2 .4.25.tar.gz
MD5 checksum
■ Confirm the source code compilation environment
●A compiler supporting C/C++ programming language needs to be installed, such as:
◆gcc, gcc-c++, make,
Compile and install process
1: tar unpack
■It is customary to release the software package to the /usr/src/ directory
■The location of the source code file after unpacking
●/usr/src/software name-version number/
■Example
[root@localhost ~]# tar zxf httpd-2.4.25.tar.gz(-C /usr/src/
Unzip the source code package and specify the release directory
2: ./configure configuration
■Use the configure script in the source directory
■Execute "./configure --help" to view the help
■Typical configuration options
■–prefix=software installation directory
■Example
[root@localhost ~]# cd /usr/src/httpd-2.4.251
[root@localhost httpd-2.4.25]#./Iconfigure -prefix=/usr/local/apache
If you do not specify any configuration options, the default values will be used
3: make compile and install
■Compile
●Execute make command
■Install
●Execute make install command
■Sample
[root@localhost httpd-2.4. 25]# make
[root@localhost httpd-2.4.25]# make install
Test, apply, maintain software
before use
[root@localhost httpd-2 4.25]# vjm /usrlocal/apache/conf/httpd.conf
■Start Apache
[root@localhost httpd-2.4.25]# /usrl/local/apache/bin/apachectl start
■Run lynx 127.0.0.1 to view the running status of native Apache