SSL平行支撑的两个端口不工作在静态编译Apache2的二进制

问题描述:

我观察了以下问题:SSL平行支撑的两个端口不工作在静态编译Apache2的二进制

的Apache2是用下面的标志编译:

./configure \ 
    --prefix=/usr \ 
    --sysconfdir=/etc \ 
    --localstatedir=/var \ 
    --host=arm-cortexa9-linux-gnueabi \ 
    --build=i686-host-linux-gnu \ 
    --includedir=/usr/include/apache2 \ 
    --enable-ssl \ 
    --with-ssl \ 
    --enable-ssl-staticlib-deps \ 
    --enable-mods-static="headers rewrite gd log_config mime alias actions unixd access_compat authn_core authz_core cgi ssl http2" \ 
    --with-apr=/opt/PHYTEC_BSPs/PTXDist/platform-phyFLEX-i.MX6/sysroot-target/usr/bin/apr-1-config \ 
    --with-apr-util=/opt/PHYTEC_BSPs/PTXDist/platform-phyFLEX-i.MX6/sysroot-target/usr/bin/apu-1-config \ 
    BUILDCC=/usr/bin/gcc \ 
    --with-mpm=prefork 

这导致了一个二进制以下模块编译

Compiled in modules: 
    core.c 
    mod_authn_core.c 
    mod_authz_core.c 
    mod_access_compat.c 
    mod_so.c 
    http_core.c 
    mod_mime.c 
    mod_log_config.c 
    mod_headers.c 
    mod_ssl.c 
    mod_http2.c 
    prefork.c 
    mod_unixd.c 
    mod_cgi.c 
    mod_actions.c 
    mod_alias.c 
    mod_rewrite.c 

ports.conf在端口443和80使得能够收听:

Listen 80 

<IfModule ssl_module> 
    Listen 443 
</IfModule> 

的网站最简单的配置如下:

<VirtualHost *:443> 
    <IfModule ssl_module> 
     SSLEngine On 
     SSLCertificateFile /etc/ssl/certs/cert.crt 
     SSLCertificateKeyFile /etc/ssl/private/key.pem 
    </IfModule> 
</VirtualHost> 

我们将使用第二个端口80用于自动化重定向到HTTPS页面。对于手头的问题,相应的VirtualHost不是必需的。

实际上,如果从ports.conf中删除Listen 80,则对https页面(https://192.168.2.3:443)的请求正在工作。这意味着ssl支持已正确编译到二进制文件中。如果均为Listen指令存在于ports.conf中,那么对https页面(https://192.168.2.3:443)的请求仍然没有响应。甚至没有ERR_ *响应。

关于ports,apache2,ssl的几个不同的搜索没有帮助缩小问题的范围。与标准apache2二进制文件相同的配置完美无瑕。增加LogLeveldebug给出了两个afforementioned场景相同的输出:

[ssl:info] [pid 1583025418028449792] [client 192.168.2.82:51478] AH01964: Connection to child 0 established (server localhost:443) 
[ssl:debug] [pid 9122084304870461440] ssl_engine_kernel.c(2143): [client 192.168.2.82:51478] AH02645: Server name not provided via TLS extension (using default/first virtual host) 
[ssl:debug] [pid 9122084442309416064] ssl_engine_kernel.c(2143): [client 192.168.2.82:51478] AH02645: Server name not provided via TLS extension (using default/first virtual host) 
[core:debug] [pid 4294967296] protocol.c(1893): [client 192.168.2.82:51478] AH03155: select protocol from , choices=h2,http/1.1 for server localhost 
[ssl:debug] [pid 7159351466806950200] ssl_engine_kernel.c(2042): [client 192.168.2.82:51478] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits) 
[ssl:debug] [pid 3905800881399477553] ssl_engine_kernel.c(366): [client 192.168.2.82:51478] AH02034: Initial (No.1) HTTPS request received for child 0 (server localhost:443) 
[authz_core:debug] [pid 3358932565584236] mod_authz_core.c(809): [client 192.168.2.82:51478] AH01626: authorization result of Require all denied: denied 
[authz_core:debug] [pid 30064771072] mod_authz_core.c(809): [client 192.168.2.82:51478] AH01626: authorization result of <RequireAny>: denied 
[authz_core:error] [pid 30064771072] [client 192.168.2.82:51478] AH01630: client denied by server configuration: /var/www/ 
[ssl:debug] [pid 2113123909637] ssl_engine_io.c(1033): [client 192.168.2.82:51478] AH02001: Connection closed to child 0 with standard shutdown (server localhost:443) 

有没有人,如果可能的模块应该被添加到二进制的想法?任何帮助将非常感激。

set ac_cv_o_nonblock_inherited = no在APR Package的配置选项中。

Cross compiling causes multiple Listen directives to not work properly