Skip to content

Edelsteine und Indianer

Ich hab mich jetzt fast 2 Monate mal mehr mal weniger damit rumgeplagt eine Ruby on Rails Applikation unterm Apache auf Debian mit Confix laufen zu lassen. Jetzt hab ich’s endlich geschafft, darum will ich meine Ergebnisse mal hier posten…

Ein genereller Tipp ist: Keine “puts” in den Quelltext. fcgi mag das nicht.

Im confixx Admin die httpd Spezial zufügen:


AllowOverride All
Options +ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch

Dann die Datei /etc/apache2/httpd.conf anpassen:

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Die .htaccess:

# General Apache options
AddHandler fastcgi-script fcg fcgi fpl
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 “Application error – Rails application failed to start properly”

Und die dispatch.fcgi:

#!/usr/bin/ruby1.8
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off). A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
require File.dirname(__FILE__) + “/../config/environment”
require ‘fcgi_handler’

RailsFCGIHandler.process!

Hier ist eine ganz Beschreibung die recht gut ist.

Published inDeutschProjekte

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *