1. Install the Build tool
[[email protected] httpd-2.4.25] # Yum Groupinstall ' development Tools ' Server Platform development '
2. Install the packages on which httpd depends
Yum install-y apr-devel apr-util-devel openssl-devel libevent-devel pcre-devel
3. Unzip the compilation
./configure--prefix=/usr/local/apache24--sysconfdir=/etc/httpd24--enable-so--enable-ssl--enable-cgi-- Enable-rewrite--enable-modules=most--enable-mpms-shared=all--with-pmp=prefork--with-zlib--with-pcre--with-apr= /usr--with-apr-util=/usr
Compilation instructions
--prefix specifying the program installation directory--Sysconfdir indicates the directory where the configuration file resides--enable-So means the dynamic load-loading function of the module is enabled--enable-ssl means that the SSL feature is enabled, and this entry may need to be installed first openssl-Devel Bag--enable-CGI indicates the ability to enable CGI-enabled mechanisms--enable-rewrite support URL rewriting feature--enable-modules=most indicates which HTTP modules are enabled, most of which means that most--enable-mpms-shared=all indicates which MPM modules are enabled for sharing (prefork, worker, event), all for all, and this is a unique option for httpd2.4, since only 2.4 supports MPM's dynamic loading and unloading,2. 2 MPM is static and only compiled in order to use--with-pmp=Prefork indicates which MPM is started by default--with-zlib indicates dependency zlib, which is useless to support compression=The equals sign indicates the path to the zlib, and the system will automatically go to the default path of the dependent file, if the dependent file is not RPM installed, or is not placed in the default path, it will need to be manually exploited=The equals sign indicates the path--with-Pcre represents a dependent pcre that supports regular expressions when URL rewriting is supported--with-Apr -dependent Apr--with-apr-util-dependent Apr-util
Dual-Core compilation started
[[email protected] httpd-2.4.25] # make-j 2 && make install
4. Export PATH environment variable, header file and man manual location
[[email protected] httpd-2.4.25] # echo "Export path=/usr/local/apache24/bin: $PATH" >/etc/profile.d/httpd24.sh [[email protected] httpd-2.4.25] # ln-sv/usr/local/apache24/include/ /usr/include/http24'/USR/INCLUDE/HTTP24 '/usr/local/ apache24/include/' [[email protected] httpd-2.4.25]# echo "Mandatory_manpath /usr/local/ Apache24/man ">>/etc/man_db.conf
[[email protected] httpd-2.4.25] # source/etc/profile.d/httpd24.sh
5. Launch Apache
The cause of the error is that servername is not configured and can be seen by the SS command on 80 ports
centos7.2 under compile and install apache2.4