Apache2 Ubuntu 500 错误

Apache2 Ubuntu 500 错误
[Sun Jul 05 10:19:53.611919 2015] [mpm_event:notice] [pid 4170:tid 140530536925056] AH00489: Apache/2.4.10 (Ubuntu) configured -- resuming normal operations
[Sun Jul 05 10:19:53.612026 2015] [core:notice] [pid 4170:tid 140530536925056] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 05 10:21:57.290092 2015] [mpm_event:notice] [pid 4170:tid 140530536925056] AH00491: caught SIGTERM, shutting down
[Sun Jul 05 10:21:58.355151 2015] [mpm_event:notice] [pid 4412:tid 139991928010624] AH00489: Apache/2.4.10 (Ubuntu) mod_wsgi/3.5 Python/2.7.8 configured -- resuming normal operations
[Sun Jul 05 10:21:58.355253 2015] [core:notice] [pid 4412:tid 139991928010624] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 05 10:37:37.221014 2015] [mpm_event:notice] [pid 4412:tid 139991928010624] AH00491: caught SIGTERM, shutting down
[Sun Jul 05 10:37:38.236367 2015] [mpm_event:notice] [pid 19041:tid 140166905907072] AH00489: Apache/2.4.10 (Ubuntu) mod_wsgi/3.5 Python/2.7.8 configured -- resuming normal operations
[Sun Jul 05 10:37:38.236487 2015] [core:notice] [pid 19041:tid 140166905907072] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 05 10:53:52.505614 2015] [mpm_event:notice] [pid 19041:tid 140166905907072] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

这些是日志中的最后记录。页面显示:500 内部服务器错误。

我正在使用 digitalocean.com 部署 Flask 应用程序

答案1

如果您收到 500 错误响应并且日志中没有任何内容,那么错误响应看起来像 Flask 生成的错误还是来自 Apache 的通用错误页面?

很可能来自 Flask,它捕获异常并将其转换为自己的 500 错误响应页面。

您可以做的是暂时启用 Flask 调试模式,以便它在浏览器中显示错误的详细信息,或者以某种方式启用 Flask 记录异常的详细信息。

如果 Flask 不能以某种方式显示异常的详细信息,就不可能猜测问题是什么。

相关内容