Apache gives 400 error on FastCGI VirtualHost
Apache issues an HTTP 400 "Bad Request" code response without any details whenever I access a FastCGI-driven script page.
- I have installed mod_fcgid module and loaded and configured in Apache config files
- I have tested several FastCGI scripts, all of them run when executed directly.
- Static resources are served appropriately.
- Apache is trying to run the script because it complains when I rewrite the url of a non-existent script
Does anyone know what happened to my 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>
EDIT - I checked the mod_rewrite logs and the URIs are rewritten correctly.
source to share
Ok, one more thing to try.
http://httpd.apache.org/docs/2.2/mod/core.html#loglevel .
Set the log level for debugging and make sure it is not on a production machine because it produces a lot of output per event (get / put).
I think your FastCGI example above is missing something, but I admit it has been a while since I did anything other than php or python fastcgi.
What language is dispatch.fcgi in? Can you execute it from the command line and Apache has permission to execute the file? (sudo su apacheaccount).
Update: Knew you were missing something: check -> http://fastcgi.coremail.cn/configuration.htm FCGIWrapper is needed to quickly tell cgi what to use to execute dispatch.fcgi file.
source to share