在msys2上建立httpd失败,并出现以下错误:
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
在实际的Linux发行版上,安装expat-devel软件包似乎可以解决问题see here, 更确切地说,expat-devel是apr-util的先决条件 至少在msys2上缺少其标头。
由于没有可用的expat-devel包或头文件,因此如何用msys构建httpd? 在配置httpd --with-included-apr时,apr-utils在哪里寻找expat标头或如何配置它?
更准确地说,CHANGES-APR-UTIL-1.6文档说
使用APR-util 1.6.0进行的更改
*)不再使用apr-util的expat依赖关系构建 apr-util。 首先安装expat(包括开发标头和库) 在构建apr-util之前。
应该在httpds构建目录树中的什么位置安装expat标头和库?
答案 0 :(得分:0)
我终于不得不单独建造外国人, 然后出现了其他错误并找到了解决方案,这要归功于 this链接用于缺少libtool,而that链接用于在不生成导出重新定义的情况下构建expat的有效方法。
在此处找到完整的构建脚本:
pacman -S make gcc libcrypt perl unzip libtool msys/libcrypt-devel
cd OpenSSL_1_1_1-stable
curl http://mirrors.standaloneinstaller.com/apache/httpd/httpd-2.4.38.tar.gz --output httpd-2.4.38.tar.gz
tar xvf httpd-2.4.38.tar.gz
cd $HOME
git clone --branch OpenSSL_1_1_1-stable https://github.com/openssl/openssl.git
mv openssl OpenSSL_1_1_1-stable
cd OpenSSL_1_1_1-stable
./configure gcc --prefix=$HOME/openssl
make
make install
cd $HOME
wget https://github.com/libexpat/libexpat/releases/download/R_2_2_6/expat-2.2.6.tar.bz2
tar xjvf expat-2.2.6.tar.bz2
cd $HOME/expat-2.2.6
./configure --prefix=$HOME/httpd --exec-prefix=$HOME/httpd
make
make install
cd $HOME
curl http://mirrors.standaloneinstaller.com/apache//apr/apr-1.6.5.tar.gz --output apr-1.6.5.tar.gz
tar xvf apr-1.6.5.tar.gz
curl http://mirrors.standaloneinstaller.com/apache//apr/apr-util-1.6.1.tar.gz --output apr-util-1.6.1.tar.gz
tar xvf apr-util-1.6.1.tar.gz
cd $HOME/apr-1.6.5
./configure --prefix=$HOME/httpd
make
make install
cd $HOME/apr-util-1.6.1
./configure --prefix=$HOME/httpd --with-apr=$HOME/httpd --with-expat=$HOME/httpd
make
make install
cd $HOME
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
tar xvf pcre-8.43.tar.gz
cd pcre-8.43
./configure --prefix=$HOME/pcre
make
make install
cd $HOME
wget https://github.com/nghttp2/nghttp2/releases/download/v1.37.0/nghttp2-1.37.0.tar.gz
tar xvf nghttp2-1.37.0.tar.gz
cd $HOME/nghttp2-1.37.0
./configure --exec-prefix=$HOME/httpd --prefix=$HOME/httpd
make
make install
cd $HOME/httpd-2.4.38
./configure --prefix=$HOME/httpd --with-expat==$HOME/httpd --with-apr-util=$HOME/httpd --with-apr=$HOME/httpd --with-pcre=$HOME/pcre --enable-ssl --enable-ssl-staticlib-deps --with-ssl=$HOME/openssl --enable-proxy --enable-proxy-connect --enable-proxy-http --enable-proxy-balancer --enable-http2 --enable-nghttp2-staticlib-deps --with-nghttp2=$HOME/nghttp2
make
make install
构建过程成功完成, 但很有用,因为httpd无法按照here
所述加载其动态模块,所以不能使用运行时