EC2 - ERR_CONNECTION_TIMED_OUT

EC2 - ERR_CONNECTION_TIMED_OUT

Linux, Apache 웹 서버 및 nodejs 앱을 실행하는 ec2 무료 등급 인스턴스가 있습니다.

보안 그룹을 구성했는데 지금까지는 정상적으로 작동했습니다.

하지만 이제 포트가 있는 DOMAIN 또는 IP를 통해 서버에 액세스할 수 없습니다(인바운드 규칙에서 포트가 열렸습니다).

원격 서버에 SSH를 사용하고 pm2를 기록하지만 정상적으로 작동합니다. 그런 다음 lynx를 사용하여 명령에서 localhost를 브라우저하고 nodejs 앱은 해당 포트에서 계속 실행 중입니다.

Apache 로그가 활성(실행 중)입니다.

이 글을 쓰기 전에는 SSH를 서버에 연결할 수 없고 인스턴스가 StatusCheckFailed_Instance 상태여서 인스턴스를 재부팅하니 정상적으로 작동했습니다. 그 후 2시간쯤 지나서 다시 접속을 해보니 이런 문제가 발생했습니다.

누구든지 이 문제를 일으키는 원인을 제안할 수 있습니까? 감사해요.

업데이트

EC2 인스턴스를 재부팅하면 정상적으로 작동하지만 10분 후에는 서버에 연결할 수 없습니다.

error_log에서 Apache 로그로 이동합니다.

[Sat Aug 22 17:28:34.698537 2020] [mpm_event:notice] [pid 5050:tid 140422190045376] AH00492: caught SIGWINCH, shutting down gracefully
[Sat Aug 22 17:32:05.288561 2020] [suexec:notice] [pid 3666:tid 140585338529984] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Aug 22 17:32:05.314134 2020] [lbmethod_heartbeat:notice] [pid 3666:tid 140585338529984] AH02282: No slotmem from mod_heartmonitor
[Sat Aug 22 17:32:05.316840 2020] [mpm_event:notice] [pid 3666:tid 140585338529984] AH00489: Apache/2.4.43 () OpenSSL/1.0.2k-fips configured -- resuming normal operations
[Sat Aug 22 17:32:05.316866 2020] [core:notice] [pid 3666:tid 140585338529984] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    

[Sat Aug 22 17:32:05.637067 2020] [proxy:error] [pid 3670:tid 140584547055360] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:6969 (127.0.0.1) failed
[Sat Aug 22 17:32:05.637097 2020] [proxy_http:error] [pid 3670:tid 140584547055360] [client *****:****] AH01114: HTTP: failed to make connection to backend: 127.0.0.1, referer: https://***.herokuapp.com/profile

17:32에 IP에 액세스했습니다. 10분 후에는 다운됩니다. 하지만 로그 파일에는 17:32에도 오류가 발생합니다.

이것은 내 아파치 구성입니다.

<VirtualHost *:80>    
     ServerAdmin **@gmail.com    
     DocumentRoot /var/www/html/hhs_api    
     ServerName api.***.xyz    
     Redirect / https://api.***.xyz/
    <Directory "/var/www/html/hhs_api">
         Order deny,allow
         Allow from all
         AllowOverride All
         Require all granted
   </Directory>    
<Location />
</Location>    
</VirtualHost>

SSL 설정입니다

<VirtualHost _default_:443>
    SSLEngine On
    SSLProxyEngine On
    ProxyRequests Off
    ProxyPreserveHost On
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off
    ServerAdmin ***@gmail.com
    DocumentRoot /var/www/html/hhs_api
    ServerName api.***.xyz
    SSLCertificateFile "/etc/httpd/conf/hhs_api-ssl/certificate.crt"
    SSLCertificateChainFile "/etc/httpd/conf/hhs_api-ssl/ca_bundle.crt"
    SSLCertificateKeyFile "/etc/httpd/conf/hhs_api-ssl/private.key"

        ProxyPass /  http://127.0.0.1:6969/
        ProxyPassReverse / http://127.0.0.1:6969/

    <Directory "/var/www/html/hhs_api">
         Order deny,allow
         Allow from all
         AllowOverride All
         Require all granted
   </Directory>
</VirtualHost>

오늘 전에는 모든 것이 잘 작동했습니다. 왜인지 모르겠습니다.

관련 정보