Compile and install Apache httpd 2.4 under centos 7

The minimal installation version of centos 7.4, using the source of Alibaba Cloud, has been updated by yum update before installation


  1. The latest version of Apache HTTP Server download address
    http://httpd.apache.org/download.cgi

    Apache official website installation instructions
    http://httpd.apache.org/docs/2.4/install.html#install

    In addition to Apache httpd, download two dependent environments,
    download addresses:http://apr.apache.org/download.cgi

  2. After decompressing the downloaded two APR and APR-Util, rename and remove the version number respectively, just the apr folder and apr-util folder, and then move these two folders to the httpd root directory. Inside the srclib folder,

  3. configure apache./configure

    Encountered an error message: configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
    Solution:
    sudo yum -y install pcre-devel

  4. sudo makeIt's a bit long, let's listen to the song.

    Encountered an error message: fatal error: expat.h: No such file or directory
    Solution:yum install expat-devel

    The error message is as follows, indicating that the xml-related library is missing

    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_GetErrorCode'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_SetEntityDeclHandler'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_ParserCreate'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_SetCharacterDataHandler'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_ParserFree'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_SetUserData'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_StopParser'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_Parse'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_ErrorString'
    /root/httpd-2.4.29/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to `XML_SetElementHandler'
    collect2: error: ld returned 1 exit status
    make[2]: *** [htpasswd] Error 1
    make[2]: Leaving directory `/root/httpd-2.4.29/support'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/root/httpd-2.4.29/support'
    make: *** [all-recursive] Error 1

    Solution:yum install -y libxml2-devel

  5. sudo make testCompile and test, there are 11316 entries to check Oh, have a coffee first.

  6. sudo make installCompile and install

Guess you like

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