経緯と実現したいこと
・従前、awsインスタンス(Amazon Linux2 AMI)にwebサーバを構築し、Wordpressでwebサイトを作成しドメインも取得し運用中であった。
・streamlitをEC2上で稼働した後、元に戻そうとしたところエラーメッセージ表示され元のサイトが表示できなくなった。
・元のサイトを表示できるようにしたく、お知恵を拝借できますと幸いです。
実施したこと
1.EC2へのstreamlitインストール
$ pip3 install streamlit
2.plotly_expressもインストール
$ pip3 install plotly_express
3.EC2のセキュリティグループでインバウンド設定に8501を追加(streamlitのアプリケーションが8501ポートで待ち受けているため)
4.EC2上でstreamlitのPGMを実行
$ streamlit run xx.py
5.上記実施後、当該webサイトに対して、IPアドレスとポートを直接指定(↓)すれば、streamlitで作成したサイトにアクセスできることは確認
http://xx.xx.xx.xx:8501
6.しかし、その後、streamlitを停止し、当初のドメイン名でアクセスしようとしたところ以下のエラーメッセージが表示され、元のwebサイトは表示できなかった。
発生している問題・エラーメッセージ
該当のURLにアクセスしようとすると以下の画面が表示されます。
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apacheのerror_logには以下のようなエラーが30秒ごとに出力されています。 10.0.10.0/24は当該EC2のサブネットでして、ローカルループバックアドレスのstreamlitが使うポート(8501)に接続しにいってしまっていることは分かるのですが、解決法が分からず。
[Fri Mar 17 12:56:38.985703 2023] [proxy:error] [pid 2990] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8501 (localhost:8501) failed [Fri Mar 17 12:56:38.985746 2023] [proxy_http:error] [pid 2990] [client 10.0.10.246:17386] AH01114: HTTP: failed to make connection to backend: localhost [Fri Mar 17 12:56:38.985854 2023] [proxy:error] [pid 2991] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8501 (localhost:8501) failed [Fri Mar 17 12:56:38.985882 2023] [proxy_http:error] [pid 2991] [client 10.0.10.246:17370] AH01114: HTTP: failed to make connection to backend: localhost
試したこと
・EC2のセキュリティグループを元に戻しても同様
・IPアドレス直接指定でアクセスしようとすると「このサイトにアクセスできません」が表示される
参考
wordpressに導入しているプラグインは、上記の状況につきwebからadmin画面にログインできませんが、
/wordpress/wp-content/plugins
を見る限りは
akismet
のみです。
httpd.confの中についてもコメントアウト以外を抜粋して記載します。
ServerRoot "/etc/httpd" Listen 80 Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@localhost <Directory /> AllowOverride none Require all denied </Directory> DocumentRoot "/var/www/html" <Directory "/var/www"> AllowOverride None # Allow open access: Require all granted </Directory> <Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/error_log" LogLevel warn <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" </IfModule> <Directory "/var/www/cgi-bin"> AllowOverride None Options None Require all granted </Directory> <IfModule mime_module> TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 <IfModule mime_magic_module> MIMEMagicFile conf/magic </IfModule> EnableSendfile on <IfModule mod_http2.c> Protocols h2 h2c http/1.1 </IfModule> IncludeOptional conf.d/*.conf

回答1件
あなたの回答
tips
プレビュー