Project

General

Profile

Redmine with Apache + FCGI

Added by Anonymous over 15 years ago

Hi,

since passenger didn't work so well for me (3-4 seconds on rails application start), I decided to give the FCGI solution a try but now I'm stuck.

Problem: dispatch.fcgi is not being handled by mod_fcgid. On access of the redmine app I only get a directory index.

Status:
  • mod_fcgid is loaded
  • dispatch.fcgi exists in redmine/public. these are the contents.

require File.dirname(FILE) + "/../config/environment"
require 'fcgi_handler'

RailsFCGIHandler.process!

  • .htaccess in redmine/public looks like this:

<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
<IfModule mod_cgi.c>
AddHandler cgi-script .cgi
</IfModule>
Options +FollowSymLinks +ExecCGI

RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On

RewriteRule $ index.html [QSA]
RewriteRule ^([
.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
<IfModule mod_fastcgi.c>
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</IfModule>
<IfModule mod_fcgid.c>
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</IfModule>
<IfModule mod_cgi.c>
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
</IfModule>

  • when I run dispatch.fcgi on the command line I get the following:

Content-Type: text/html; charset=utf-8
Set-Cookie: _session_id=adba3f2e497680092a89aa266261f632; path=/
Status: 302 Found
Location: http://:/login?back_url=http%3A%2F%2F%3A%2F
X-Runtime: 0.27737
Content-Length: 109
Cache-Control: no-cache

<html><body>You are being <a href="http://:/login?back_url=http%3A%2F%2F%3A%2F">

I really do appreciate any hints on resolve this resp. I'm open for other, easier setups that deliver good performance.

Best regards,
ray


Replies (4)

RE: Redmine with Apache + FCGI - Added by John Fisher about 15 years ago

Try taking out ALL the "*AllowOverride None*" directives from ~/sites-available/default that could relate to the public subdirectory for Redmine. Allow Override means 'allow htaccess to override the conf settings', and "none" means "dont allow..." but check the Apache docs, there isn't any other setting for AllowOverride, so just comment it out.

Now I am stuck with a running dispatch.fcgi and no error messages of interest in the crash log, and 500 error.

John

RE: Redmine with Apache + FCGI - Added by Brian Mason about 15 years ago

I am having this problem. What was your solution?

RE: Redmine with Apache + FCGI - Added by John Fisher about 15 years ago

If you are asking me, Brian....

I dumped FCGI, and used Passenger.

here is my sites-enabled section that's relevant:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
<VirtualHost *:80>
ServerAdmin
ServerName redmine.example.com
DocumentRoot /var/www/redmine/public/
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5
PassengerRuby /usr/bin/ruby1.8
RailsEnv development

&lt;Directory "/var/www/redmine/public/"&gt;
Options Indexes +ExecCGI FollowSymLinks
#AddHandler fcgid-script .fcgi
Order allow,deny
Allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;

hope this helps

RE: Redmine with Apache + FCGI - Added by ww yhy over 13 years ago

i met a problem, my fcgi is works.

but how do i make redmine works?

ror.jpg (45.4 KB) ror.jpg
    (1-4/4)