It's really quite simple to run them both. I do it all the time (ROR to run Redmine, and PHP for the rest).
You have 2 real options for ROR. Either serve it from FastCGI (what I do), or run it with a standalone server (like Mongrel, etc) and proxy to it. Both have advantages. FastCGI has the advantage that it's self-contained (no secondary server to run). The standalone has the advantage that it's easier to configure.
If you have specific questions, I can guide, but there are guides on the internet on how to do this.
My lighttpd.conf:
$HTTP["host"] =~ "my.ror.site" {
server.error-handler-404="/dispatch.fcgi"
fastcgi.server = (".fcgi" => ("ror_1" => (
"min-procs"=>8,
"max-procs" => 8,
"socket" => "/tmp/myrorlock.fastcgi",
"bin-path"=> "/path/to/ror/site/public/dispatch.fcgi",
"kill-signal" => 9,
"bin-environment" => ( "RAILS_ENV" => "production" )
)))
}
fastcgi.server = ( ".php" =>
(
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi -c /etc/php.ini",
"min-procs" => 1,
"disable-time" => 1,
"max-procs" => 1,
"idle-timeout" => 20,
"broken-scriptfilename" => "enable",
"bin-copy-environment"=> (
"PATH", "SHELL", "USER"
),
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "40",
"PHP_FCGI_MAX_REQUEST" => "50000"
)
)
)
)
And that's it. Note the kill-signal
option. that's important, otherwise you'll wind up with zombie processes everywhere every time you restart the server...
$HTTP["host"] =~ "my.ror.site"
-- The=~
means it's doing a regular expression comparison, which may not be needed. Use==
when you want to do a normal string comparison. More info. Other than that, thanks for the sample! – Storfer