0

每当我访问由 FastCGI 脚本处理的页面驱动时,Apache 都会吐出代码的 HTTP 响应:400 “Bad Request”,没有详细信息。

  • 我已经安装了 mod_fcgid 模块,并在 Apache 配置文件中加载和配置了它
  • 我测试了几个 FastCGI 脚本,它们都在直接执行时运行。
  • 适当地提供静态资源。
  • Apache 正在尝试启动脚本,因为当我将 URL 重写为不存在的脚本时它会抱怨

有人知道我的 Apache Config 有什么问题吗?

<VirtualHost ip.ad.re.ss:80>
  ServerName   demo.domain.com:80 

  DocumentRoot /var/www/vhosts/domain.com/subdomains/demo/rails/public
  CustomLog  /var/www/vhosts/domain.com/statistics/logs/demo_access_log combined
  ErrorLog  /var/www/vhosts/domain.com/statistics/logs/demo_error_log
  LogLevel info
  Options +FollowSymLinks +ExecCGI -SymLinksIfOwnerMatch
  AddHandler fcgid-script .fcgi

  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</VirtualHost>

编辑——我检查了 mod_rewrite 日志并且 URI 被正确重写

4

2 回答 2

0

Alright, one more thing to try.
http://httpd.apache.org/docs/2.2/mod/core.html#loglevel.

Set the log level to debug and make sure this is not on a production machine because it produces a lot of output per individual event (get/put).

I think how your example above of FastCGI is missing something, but I admit its been a while since I've done anything but php or python fastcgi.
What language is dispatch.fcgi in? Can you execute it from the command line and does Apache have permission to execute the file? ( sudo su apacheaccount ).

Update: Knew you were missing something: check out -> http://fastcgi.coremail.cn/configuration.htm FCGIWrapper is needed to tell fast cgi what to use to execute your dispatch.fcgi file.

于 2008-12-21T23:08:09.723 回答
0

尝试删除 DOCUMENT_ROOT 重写条件。其次,检查 mod_rewrite 日志指令,就此类奇怪的问题而言,它们非常有用。

于 2008-12-21T04:43:40.327 回答