无法使用perl Dancer的fcgi运行应用程序

无法使用perl Dancer的fcgi运行应用程序,perl,fastcgi,dancer,Perl,Fastcgi,Dancer,我正在测试如何使用fcgi部署Dancer的测试示例。但它就是不起作用。 我一直收到错误消息: File does not exist: /home/tester/MyApp/public/dispatch.fcgi/ 但是,此应用程序可以使用cgi成功运行。我已经根据dancer的部署手册对http.conf进行了更改 有人能给我指出这个错误的一些解决方案或可能的原因吗 以下是http.conf文件: <VirtualHost *:80> ServerName local

我正在测试如何使用fcgi部署Dancer的测试示例。但它就是不起作用。 我一直收到错误消息:

File does not exist: /home/tester/MyApp/public/dispatch.fcgi/
但是,此应用程序可以使用cgi成功运行。我已经根据dancer的部署手册对http.conf进行了更改

有人能给我指出这个错误的一些解决方案或可能的原因吗

以下是http.conf文件:

<VirtualHost *:80>
    ServerName localhost

    # /srv/www.example.com is the root of your
    # dancer application
    DocumentRoot /home/tester/MyApp/public

    ServerAdmin you@example.com

    <Directory "/home/tester/MyApp/public">
       AllowOverride None
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
       Order allow,deny
       Allow from all
       AddHandler fastcgi-script .fcgi
    </Directory>

    ScriptAlias / /home/tester/MyApp/public/dispatch.fcgi/

    ErrorLog  /var/log/apache2/MyApp-error.log
    CustomLog /var/log/apache2/MyApp-access_log common
</VirtualHost>

服务器名本地主机
#/srv/www.example.com是您的
#舞者应用
DocumentRoot/home/tester/MyApp/public
服务器管理员you@example.com
不允许超限
选项+执行CGI-多视图+符号链接所有者匹配
命令允许,拒绝
通融
AddHandler fastcgi script.fcgi
ScriptAlias//home/tester/MyApp/public/dispatch.fcgi/
ErrorLog/var/log/apache2/MyApp-error.log
CustomLog/var/log/apache2/MyApp-access\u log common

谢谢

我不认为ScriptAlias是您想要使用的。从文档中

该指令与别名具有相同的行为 指令,除此之外,它还将目标目录标记为 包含将由mod_CGI的CGI脚本处理的CGI脚本 处理程序

基本上,Apache查找名为“/home/tester/MyApp/public/dispatch.fcgi/”的目录,该目录中的每个文件都通过mod_cgi进行处理。在这种情况下,无法找到它,因为它是一个常规文件

你试过使用吗?我的用于Dancer的httpd配置与您的几乎相同,只是我使用的是mod_rewrite

DocumentRoot /home/user/src/MyApp/public
<Directory "/home/user/src/MyApp/public">
  AllowOverride None
  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
  AddHandler fcgid-script .fcgi #using fcgid instead of fastcgi
</Directory>

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /dispatch.fcgi$1 [QSA,L]
DocumentRoot/home/user/src/MyApp/public
不允许超限
选项+执行CGI-多视图+符号链接所有者匹配
命令允许,拒绝
通融
AddHandler fcgid script.fcgi#使用fcgid而不是fastcgi
重新启动发动机
重写cond%{DOCUMENT\u ROOT}%{REQUEST\u FILENAME}-F
重写cond%{DOCUMENT\u ROOT}%{REQUEST\u FILENAME}-D
重写规则^(.*)$/dispatch.fcgi$1[QSA,L]

您在该目录中有名为
dispatch.fcgi
的文件吗?有。正如我提到的,我使用的是Dancer的测试示例,它是由“Dancer-a MyApp”创建的。在/MyApp/public/中有“dispatch.fcgi”,根据它在
/home/tester/MyApp/public中需要出现的错误,它在/home/tester/MyApp/public中,我在响应中省略了第一部分。在错误消息的末尾真的有一个/吗?如果是这样的话,有些东西可能被误解了。谢谢你戈多里奥。你的方法很有魅力。我只需要使用“sudoa2enmodrewrite”启用模块,并使用您的配置。它起作用了!太好了!是的,我想我可以让舞蹈队知道他们应该更新他们的文档。我很想知道他们中有多少人在apache上使用某种快速cgi。还有一个问题,我需要在request.uri_base不起作用的情况下发送给他们。如果你有问题,让我知道,我可以告诉你如何解决它的方向。当然,如果我遇到同样的问题,我会告诉你。