【发布时间】:2011-10-05 19:42:51
【问题描述】:
第一次发帖,好久没来这里了。
我在 plackup 中使用了一个小型 PSGI 应用程序,但我喜欢切换到 Apache2 的子域。我使用“plackup /home/ath88/work/kolle/script/dir.psgi -port 80”运行应用程序。它可以完美地运行在 plackup 上。该应用程序非常简单,可以在https://github.com/ath88/Kolletilmelding/blob/master/script/dir.psgi找到
但是,出于显而易见的原因,我想运行 Apache2 而不是 plackup。为此,我想使用 Plack::Handler::Apache2。我的 VirtualHost 如下所示:
<VirtualHost *:80>
ServerName aths.dk
ServerAdmin asbjoern@gmail.com
<Location />
SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app /home/ath88/work/kolle/script/dir.psgi
</Location>
</VirtualHost>
Apache2 重新启动正常。但是当我尝试访问 aths.dk 时,我只是得到一个 404 未找到。应用程序的目录是正确的,因为它会导致 500 内部错误。查看 apache2/error.log 我得到以下信息:[不相关,请参阅编辑]
[Wed Oct 05 21:32:16 2011] [notice] caught SIGTERM, shutting down
[Wed Oct 05 21:32:17 2011] [notice] Apache/2.2.12 (Ubuntu) mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations
每次我重新启动 Apache2 时都会发生这种情况。
我花了 4 个小时尝试调试它。我完全难以置信。
编辑:原来 SIGTERM 来自停止 Apache2 以重新启动。当我启动它时它不会发生。傻我。
【问题讨论】:
-
也许还可以从 access.log 中添加一些输出,看看它在请求什么?
标签: perl ubuntu apache2 plack psgi