Apache is the name of a foundation, and HTTPD is the package we need to install.
Apr and apr-util are a common function library, it makes httpd can not relate to the underlying operating system platform, can be easily ported, if you do not install the two, httpd will not work.
Steps
1. Download httpd, Apr and Apr-util
wget Http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gzwget http://mirrors.cnnic.cn/apache/apr/ Apr-1.6.3.tar.gzwget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.bz2
2, decompression httpd, Apr and Apr-util
Tar zxvf httpd-2.4.29.tar.gztar zxvf apr-1.6.3.tar.gztar jxvf apr-util-1.6.1.tar.bz2
3. Install Apr
Cd/usr/local/src/apr-1.6.3./configure-prefix=/usr/local/aprmake && make Install
4, Installation Apr-util
Cd/usr/local/src/apr-util-1.6.1./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR
(Install apr-util dependent APR)
The installation process may cause the following error
Libtool:link:cannot Find the library '/usr/local/src/apr-util-1.6.1/xml/expat/libexpat.la ' or unhandled argument '/usr /local/src/apr-util-1.6.1/xml/expat/libexpat.la ' make:*** [libaprutil-1.la] Error 1
The solution is:
Yum Install-y expat-devel
5, installation httpd
Cd/usr/local/src/httpd-2.4.29./configure \//The backslash here is an escape character, plus he can write a line of commands into multiple lines--prefix=/usr/local/apache2.4--with-apr=/ USR/LOCAL/APR--with-apr-util=/usr/local/apr-util--enable-so--enable-mods-shared=most
Here--prefix specify the installation directory,
--enable-so means that enabling DSO,DSO means displaying certain functions in the form of modules.
--enbale-mods-shared=most indicates that most of the feature modules are installed in a shared manner and will be visible under the modules directory after installation.
To avoid make errors, install some library files in advance
Yum install-y pcre Pcre-devel
Compile
Makemake Install
After the installation is complete, you can view the module files under modules
Ls/usr/local/apache2.4/modules
These modules are not fully loaded and can be configured in the configuration file if you want to use which modules.
See which modules are loaded:
/usr/local/apache2.4/apachectl-m
Or
/usr/local/apache2.4/httpd-m
Installation of Apache under Linux