発生する問題
さくらのVPSを用いて作成したサーバーにアクセスする際の問題です。
作成したサーバーに直接IPアドレスを入れてアクセスする分には表示されるのですが、
さくらのドメインで取得したドメイン名でアクセスするとエラー(ERR_CONNECTION_REFUSED)が発生してしまいます。
ですが、PINGコマンドを試したところドメインとIPアドレス自体は機能しているようでした。
ApacheとFlaskを使うために、Gunicornを使用しているのですが、その設定またはApacheの設定の問題なのでしょうか。
###エラーログ
[Tue Oct 26 19:37:46.291699 2021] [proxy:error] [pid 1588] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8000 (127.0.0.1) failed [Tue Oct 26 19:37:46.291841 2021] [proxy:error] [pid 1588] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s [Tue Oct 26 19:37:46.291854 2021] [proxy_http:error] [pid 1588] [client 186.233.180.156:31116] AH01114: HTTP: failed to make connection to backend: 127.0.0.1 [Tue Oct 26 19:48:09.324030 2021] [proxy:error] [pid 1590] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8000 (127.0.0.1) failed [Tue Oct 26 19:48:09.324166 2021] [proxy:error] [pid 1590] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s [Tue Oct 26 19:48:09.324189 2021] [proxy_http:error] [pid 1590] [client 205.185.120.103:52628] AH01114: HTTP: failed to make connection to backend: 127.0.0.1 [Tue Oct 26 19:55:05.388598 2021] [mpm_prefork:notice] [pid 1586] AH00170: caught SIGWINCH, shutting down gracefully [Tue Oct 26 19:55:06.470178 2021] [suexec:notice] [pid 1849] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Tue Oct 26 19:55:06.499075 2021] [lbmethod_heartbeat:notice] [pid 1849] AH02282: No slotmem from mod_heartmonitor [Tue Oct 26 19:55:06.530055 2021] [mpm_prefork:notice] [pid 1849] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations [Tue Oct 26 19:55:06.530088 2021] [core:notice] [pid 1849] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Tue Oct 26 19:56:32.893295 2021] [mpm_prefork:notice] [pid 1849] AH00170: caught SIGWINCH, shutting down gracefully [Tue Oct 26 19:56:33.979388 2021] [suexec:notice] [pid 1875] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Tue Oct 26 19:56:34.006135 2021] [lbmethod_heartbeat:notice] [pid 1875] AH02282: No slotmem from mod_heartmonitor [Tue Oct 26 19:56:34.036701 2021] [mpm_prefork:notice] [pid 1875] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations [Tue Oct 26 19:56:34.036737 2021] [core:notice] [pid 1875] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Tue Oct 26 19:59:46.323868 2021] [mpm_prefork:notice] [pid 1875] AH00170: caught SIGWINCH, shutting down gracefully [Tue Oct 26 19:59:47.390683 2021] [suexec:notice] [pid 1907] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Tue Oct 26 19:59:47.426916 2021] [lbmethod_heartbeat:notice] [pid 1907] AH02282: No slotmem from mod_heartmonitor [Tue Oct 26 19:59:47.452848 2021] [mpm_prefork:notice] [pid 1907] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations [Tue Oct 26 19:59:47.452879 2021] [core:notice] [pid 1907] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
###試したこと
- /etc/httpd/conf/httpd.confの変更
(ProxyRequests Off
ProxyPass "/" "http://localhost:8000/"
ProxyPassReverse "/" "http://localhost:8000/")
- パーミッションの変更
- setsebool -P httpd_can_network_connect on (そもそもSElinuxが無効でした)
- firewall-cmd --add-service=http --zone=public --permanent
- firewall-cmd --add-service=https --zone=public --permanent
- さくらのVPSでのパケットフィルタの設定変更
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。