使用fcgi的Apache Web服务器

时间:2014-07-01 09:06:51

标签: apache mod-rewrite mod-fcgid eiffel

我有Web应用程序服务器处理请求并返回在Eiffel Web框架中创建的响应并使用fcgi作为连接器,我已将最终的可执行文件放在htdocs文件(app.exe)中。

现在我想用fastcgi运行apache并启动应用程序并在localhost中运行它。 我修改了httpconf文件,如下所示,但它没有运行。

<Directory "C:/Apache2.2/htdocs">
    Options +ExecCGI +Includes +FollowSymLinks -Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

<IfModule mod_fcgid.c>

    AddHandler fcgid-script .ews
    FcgidWrapper C:/Apache2.2/htdocs/app.exe .ews

</IfModule>

<IfModule mod_rewrite.c>

    RewriteEngine on
    RewriteBase /
    RewriteRule ^$ app.ews [L]
    RewriteCond %{REQUEST_FILENAME} !­f
    RewriteCond %{REQUEST_FILENAME} !­d
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteCond %{REQUEST_URI} !service.ews
    RewriteRule ^(.*)$ service.ews/$1
    RewriteRule .* ­ [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

</IfModule>

我已经加载了2个模块fcgid并重写。

1 个答案:

答案 0 :(得分:0)

apache配置正确,在与用户调查此问题后,似乎app.exe未编译为作为libfcgi服务器运行,而是作为独立服务器运行。

使用EWF,可以编译相同的代码以作为CGI,libfcgi的独立服务器或所有这些代码运行,但在这种情况下,可执行文件的名称很重要。 这是错误。 用户修复了他的错误,无法将其应用程序作为FCGI服务器运行。