Apache SSL 구성 연결이 거부되었습니다. connect:errno=111

Apache SSL 구성 연결이 거부되었습니다. connect:errno=111

이전 opensuse 서버에서 SSL을 구성하려고 합니다.

openSUSE 11.4 (x86_64)
VERSION = 11.4
CODENAME = Celadon

Apache SSL 모듈을 활성화했습니다.

apache2ctl -M
Loaded Modules:
 core_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_default_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 dir_module (shared)
 env_module (shared)
 expires_module (shared)
 include_module (shared)
 log_config_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 userdir_module (shared)
 php5_module (shared)
 reqtimeout_module (shared)
 deflate_module (shared)
 headers_module (shared)
 rewrite_module (shared)
Syntax OK

그리고 SSL 인증서를 제공하는 가상 호스트를 구성하고(vhost-ssl.template을 복사 및 편집하고 이름을 https.xxxxxxxx.conf로 변경) 아파치를 다시 시작했습니다.

연결하려고 하면 다음 오류가 발생합니다.

openssl s_client -connect localhost:443
connect: Connection refused
connect:errno=111

설치된 openssl 버전은 다음과 같습니다.

OpenSSL 1.0.1p 9 Jul 2015 (Library: OpenSSL 1.0.0c 2 Dec 2010)

도움이 될 수 있다면 이것이 내 iptables 구성입니다.

iptables -L -vn
Chain INPUT (policy ACCEPT 4641 packets, 815K bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 1691 packets, 4745K bytes)
 pkts bytes target     prot opt in     out     source               destination   

로컬 호스트에서 443 포트에 연결할 수 없는 이유를 이해하도록 도와주실 수 있나요?

편집하다:

나는 그것이 Apache와 추가 https.xxxxxxx.conf 파일에 문제가 있다고 생각합니다.

httpd2 -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server xxxxxxxx.it (/etc/apache2/vhosts.d/xxxxxxxx.conf:3)
         port 80 namevhost xxxxxxxx.it (/etc/apache2/vhosts.d/xxxxxxxx.it.conf:3)
         port 80 namevhost XXX.XXX.XXX.XXX (/etc/apache2/vhosts.d/xxxxxxxx.it.conf:9)

내 Listen.conf에서는 SSL 모듈이 활성화된 경우 Listen 443이 발생해야 하는 것 같습니다.

Listen 80


<IfDefine SSL>
    <IfDefine !NOSSL>
        <IfModule mod_ssl.c>

            Listen 443

        </IfModule>
    </IfDefine>
</IfDefine>

이것은 netstat의 출력입니다:

netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      8105/mysqld         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1847/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2179/master         
tcp        0      0 :::80                   :::*                    LISTEN      13330/httpd2-prefor 
tcp        0      0 :::21                   :::*                    LISTEN      1930/vsftpd         
tcp        0      0 :::22                   :::*                    LISTEN      1847/sshd           
tcp        0      0 ::1:25                  :::*                    LISTEN      2179/master   

SSL 모듈을 활성화하기 위해 /etc/sysconfig/apache2 파일을 수정했습니다.

APACHE_SERVER_FLAGS="SSL"

이제 봇이 로컬 및 원격으로 올바르게 응답하는 것 같습니다.

openssl s_client -connect localhost:443
CONNECTED(00000003)
depth=3 C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root
verify return:1

브라우저에서 가져온 후에도 여전히 문제가 있습니다.

This site can’t be reached
xxxxxxxx.it unexpectedly closed the connection.
Try:

Checking the connection
Checking the proxy and the firewall
Running Network Diagnostics
ERR_CONNECTION_CLOSED

그러나 나는 문제가 관련이 없다고 생각합니다

답변1

마침내 알아 냈습니다! 기본 Apache Listen.conf에는 머신에 할당된 IP 주소에 대한 항목이 없습니다. 윽. 나는 "listen 80"이 기계의 모든 IP 주소를 다룰 것이라고 생각했습니다.

관련 정보