首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Django和ElasticBeanstalk:内部服务器错误,HTTP/2协议将不活跃

Django和ElasticBeanstalk:内部服务器错误,HTTP/2协议将不活跃
EN

Stack Overflow用户
提问于 2018-09-17 03:46:04
回答 1查看 993关注 0票数 1

我正在尝试在eb中部署Django应用程序。我已经在eb上创建了环境,即使所有事情看起来都很好,内部服务器错误也会发生。

我只是在官方网站上学习教程。我已经将我的requirements.txt.ebextensions投入到我的git中了。我在eb配置上设置了环境变量。

但是有一个内部服务器错误。而且eb open也不起作用。

.ebextensions/django.config

代码语言:javascript
复制
option_settings:
  aws:elasticbeanstalk:container:python:
   WSGIPath: config/wsgi.py

settings.py

代码语言:javascript
复制
ALLOWED_HOSTS = ["*"]

我还在本地使用sqlite3

error.log是这样的

代码语言:javascript
复制
[Mon Sep 17 03:26:31.366607 2018] [mpm_prefork:notice] [pid 10621] AH00169: caught SIGTERM, shutting down
[Mon Sep 17 03:26:32.520377 2018] [suexec:notice] [pid 11711] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Sep 17 03:26:32.536121 2018] [so:warn] [pid 11711] AH01574: module wsgi_module is already loaded, skipping
[Mon Sep 17 03:26:32.538258 2018] [http2:warn] [pid 11711] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Mon Sep 17 03:26:32.538272 2018] [http2:warn] [pid 11711] AH02951: mod_ssl does not seem to be enabled
[Mon Sep 17 03:26:32.538809 2018] [lbmethod_heartbeat:notice] [pid 11711] AH02282: No slotmem from mod_heartmonitor
[Mon Sep 17 03:26:32.538869 2018] [:warn] [pid 11711] mod_wsgi: Compiled for Python/3.6.2.
[Mon Sep 17 03:26:32.538875 2018] [:warn] [pid 11711] mod_wsgi: Runtime using Python/3.6.5.
[Mon Sep 17 03:26:32.541103 2018] [mpm_prefork:notice] [pid 11711] AH00163: Apache/2.4.33 (Amazon) mod_wsgi/3.5 Python/3.6.5 configured -- resuming normal operations
[Mon Sep 17 03:26:32.541124 2018] [core:notice] [pid 11711] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Sep 17 03:26:35.694597 2018] [:error] [pid 11716] /opt/python/run/venv/local/lib/python3.6/site-packages/storages/backends/s3boto3.py:282: UserWarning: The default behavior of S3Boto3Storage is insecure and will change in django-storages 2.0. By default files and new buckets are saved with an ACL of 'public-read' (globally publicly readable). Version 2.0 will default to using the bucket's ACL. To opt into the new behavior set AWS_DEFAULT_ACL = None, otherwise to silence this warning explicitly set AWS_DEFAULT_ACL.
[Mon Sep 17 03:26:35.694625 2018] [:error] [pid 11716]   "The default behavior of S3Boto3Storage is insecure and will change "
[Mon Sep 17 03:26:35.763182 2018] [:error] [pid 11716] /opt/python/run/venv/local/lib/python3.6/site-packages/storages/backends/s3boto3.py:282: UserWarning: The default behavior of S3Boto3Storage is insecure and will change in django-storages 2.0. By default files and new buckets are saved with an ACL of 'public-read' (globally publicly readable). Version 2.0 will default to using the bucket's ACL. To opt into the new behavior set AWS_DEFAULT_ACL = None, otherwise to silence this warning explicitly set AWS_DEFAULT_ACL.
[Mon Sep 17 03:26:35.763199 2018] [:error] [pid 11716]   "The default behavior of S3Boto3Storage is insecure and will change "

如何纠正此错误?

django-storages引起的部分解决了。但其他部分仍然是一样的。

代码语言:javascript
复制
[Mon Sep 17 06:44:13.104471 2018] [mpm_prefork:notice] [pid 18559] AH00169: caught SIGTERM, shutting down
[Mon Sep 17 06:44:14.259136 2018] [suexec:notice] [pid 19102] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Sep 17 06:44:14.274950 2018] [so:warn] [pid 19102] AH01574: module wsgi_module is already loaded, skipping
[Mon Sep 17 06:44:14.277045 2018] [http2:warn] [pid 19102] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Mon Sep 17 06:44:14.277059 2018] [http2:warn] [pid 19102] AH02951: mod_ssl does not seem to be enabled
[Mon Sep 17 06:44:14.277619 2018] [lbmethod_heartbeat:notice] [pid 19102] AH02282: No slotmem from mod_heartmonitor
[Mon Sep 17 06:44:14.277677 2018] [:warn] [pid 19102] mod_wsgi: Compiled for Python/3.6.2.
[Mon Sep 17 06:44:14.277681 2018] [:warn] [pid 19102] mod_wsgi: Runtime using Python/3.6.5.
[Mon Sep 17 06:44:14.279864 2018] [mpm_prefork:notice] [pid 19102] AH00163: Apache/2.4.33 (Amazon) mod_wsgi/3.5 Python/3.6.5 configured -- resuming normal operations
[Mon Sep 17 06:44:14.279883 2018] [core:notice] [pid 19102] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-09-17 04:21:54

如果读取错误,则django-storages应用程序将引发此问题。将此设置添加到您的settings.py中会修复此问题。

代码语言:javascript
复制
AWS_DEFAULT_ACL = None

此更改将修复您现在面临的错误,但可能还有其他问题。请分享下一个错误的更多细节。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52360482

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档