httpd官网: https://httpd.apache.org/
[DOWNLOAD] httpd-2.4.49
apr 【Documentation】【Requirements】【APR and APR-Util】
apr官网: http://apr.apache.org/
[DOWNLOAD] apr-1.7.0
[DOWNLOAD] apr-util-1.6.1
yum install -y gcc pcre-devel expat-devel libxml2-devel
tar xf httpd-2.4.49.tar.gz
tar xf apr-1.7.0.tar.gz
tar xf apr-util-1.6.1.tar.gz
apr不用单独源码安装
【Requirements】-【APR and APR-Util】
unpack them into /httpd_source_tree_root/srclib/apr and /httpd_source_tree_root/srclib/apr-util (be sure the directory names do not have version numbers; for example, the APR distribution must be under /httpd_source_tree_root/srclib/apr/) and use ./configure’s --with-included-apr option
mv apr-1.7.0 httpd-2.4.49/srclib/apr
mv apr-util-1.6.1 httpd-2.4.49/srclib/apr-util
./configure --with-included-apr; make; make install
/usr/local/apache2/bin/apachectl 可以代替/etc/init.d/httpd
【Starting at Boot-Time】
The apachectl script is designed to act like a standard SysV init script; it can take the arguments start, restart, and stop and translate them into the appropriate signals to httpd. So you can often simply link apachectl into the appropriate init directory
但是无法执行chkconfig - on
chkconfig httpd on
mv /etc/init.d/httpd /etc/init.d/httpd_org
ln -s /usr/local/apache2/bin/apachectl /etc/init.d/httpd
mv /usr/sbin/apachectl /usr/sbin/apachectl_org
ln -s /usr/local/apache2/bin/apachectl /usr/sbin/apachectl
分解问题处理
configure阶段
configure: error: in `/usr/local/src/httpd-2.4.49/srclib/apr’:
configure: error: no acceptable C compiler found in $PATH
yum install -y gcc
checking for pcre-config… false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
yum install -y pcre-devel
也可以源码安装pcre,并且./configure时候指定pcre路径
make阶段
xml/apr_xml.c:35:19: 错误:expat.h:没有那个文件或目录
xml/apr_xml.c:66: 错误:expected specifier-qualifier-list before ‘XML_Parser’
xml/apr_xml.c: 在函数‘cleanup_parser’中:
xml/apr_xml.c:364: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:365: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c: 在文件层:
xml/apr_xml.c:384: 错误:expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
xml/apr_xml.c: 在函数‘apr_xml_parser_create’中:
xml/apr_xml.c:401: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:402: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:410: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:411: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:412: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:424: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:424: 错误:‘default_handler’未声明(在此函数内第一次使用)
xml/apr_xml.c:424: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
xml/apr_xml.c:424: 错误:所在的函数内也只报告一次。)
xml/apr_xml.c: 在函数‘do_parse’中:
xml/apr_xml.c:434: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:438: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:442: 错误:‘apr_xml_parser’没有名为‘xp_err’的成员
xml/apr_xml.c:442: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c: 在函数‘apr_xml_parser_geterror’中:
xml/apr_xml.c:500: 错误:‘apr_xml_parser’没有名为‘xp_err’的成员
xml/apr_xml.c:500: 错误:‘apr_xml_parser’没有名为‘xp_err’的成员
make[3]: *** [xml/apr_xml.lo] 错误 1
make[3]: Leaving directory/usr/local/src/httpd-2.4.49/srclib/apr-util' make[2]: *** [all-recursive] 错误 1 make[2]: Leaving directory/usr/local/src/httpd-2.4.49/srclib/apr-util’
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/usr/local/src/httpd-2.4.49/srclib’
make: *** [all-recursive] 错误 1
yum install -y expat-devel
/usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference to
XML_ParserCreate' /usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_GetErrorCode’
/usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_SetUserData' /usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_ErrorString’
/usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_SetEntityDeclHandler' /usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_ParserFree’
/usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_SetElementHandler' /usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_StopParser’
/usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_Parse' /usr/local/src/httpd-2.4.49/srclib/apr-util/.libs/libaprutil-1.so: undefined reference toXML_SetCharacterDataHandler’
collect2: ld returned 1 exit status
make[2]: *** [htpasswd] 错误 1
make[2]: Leaving directory/usr/local/src/httpd-2.4.49/support' make[1]: *** [all-recursive] 错误 1 make[1]: Leaving directory/usr/local/src/httpd-2.4.49/support’
make: *** [all-recursive] 错误 1
yum install -y libxml2-devel
需要再次configure
./configure --with-included-apr
319



被折叠的 条评论
为什么被折叠?



