Innate and Passenger

21 views
Skip to first unread message

Hamza Khan-Cheema

unread,
Oct 9, 2011, 4:04:22 AM10/9/11
to ram...@googlegroups.com
Hi,

I have made a simple blog engine with innate and I want to deploy it to passenger.  But I can't seem to find much documentation on what to put in the config.ru file.  How to deploy a Ramaze app is in the manual :

http://www.modrails.com/documentation/Users%20guide%20Apache.html#_ramaze

How can I adapt that to work with Innate?

Thanks.

Kind Regards
Hamza Khan-Cheema

Roy Wright

unread,
Oct 9, 2011, 6:04:42 PM10/9/11
to ram...@googlegroups.com
For my ramaze-2011.01.30 app, I just used the default config.ru.  The non-commented lines of the config.ru are:

require ::File.expand_path('../app', __FILE__)
Ramaze.start(:root => __DIR__, :started => true)
run Ramaze

IIRC, getting the app to work under passenger was trivial.  The harder parts were getting it to work under SSL and a secondary apache instance (the ramaze app is used to setup the main cluster application which uses the primary apache instance).

HTH,
Roy

--
You received this message because you are subscribed to the Google Groups "Ramaze" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ramaze/-/Y9AKkqSgZ6sJ.
To post to this group, send email to ram...@googlegroups.com.
To unsubscribe from this group, send email to ramaze+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ramaze?hl=en.

vtypal

unread,
Oct 10, 2011, 2:41:01 AM10/10/11
to Ramaze
I use the following to setup my innate apps with passenger.

That's my config.ru. You should only change <demo> appropriately with
the name of your main ruby app file (my main app file is called
demo.rb)
--------------------
## config.ru
require 'rubygems'
require 'innate'
require 'demo'

require ::File.expand_path('../demo', __FILE__)
Innate.start :started => true
Innate.options.mode = :live
run Innate
--------------------

Inside your main app file you have to exclude/comment Innate.start and
options
#Innate.options.adapter.port = 8080
#Innate.options.adapter.handler = :webrick
#Innate.start
So my demo.rb it looks like this:
-------------------------------------
#demo.rb
# encoding: utf-8
#add your needed gems
require 'rake'
require 'logger'
#require another ruby files (views,layout...)
v=FileList['view/*.rb']
l=FileList['layout/*.rb']
[v, l].each do |f|
unless f.length == 0
f.each {|ti| require f }
end
end
class Demo1
Innate.node '/'
provide :html, :engine=>:Etanni, :type=>'text/html'
helper :xhtml, :render, :aspect #js,partial_render,before/after/wrap

def index
#whatever
end
.....
end
-------------------------
In httpd.conf add the following (i use `gem install passenger` instead
of mod_rails, so it may be slightly different) :
#httpd.conf
#Load Passenger
LoadModule passenger_module /usr/lib64/ruby/gems/1.8/gems/
passenger-2.2.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /usr/bin/ruby18

#PassengerMaxPoolSize
#Default: 6
PassengerMaxPoolSize 3
#PassengerPoolIdleTime
#Default: 300
PassengerPoolIdleTime 144
#PassengerMaxInstancesPerApp < PassengerMaxPoolSize
PassengerMaxInstancesPerApp 2
#Must be used with RailsBaseURI in vhost
RailsAutoDetect off
RackAutoDetect off



Create a directory public inside your app directory and create your
apache virtualhost to point in the proper location:
#
<VirtualHost *:80>
ServerAdmin ad...@yourdomain.org
ServerName www.yourdomain.org
ServerAlias yourdomain.org
ServerSignature On
<Directory "/home/danube/rls/myinnateapp">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RackBaseURI /
DocumentRoot "/home/danube/rls/myinnateapp/public"
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i
\"" combined
ErrorLog /home/danube/rls/myinnateapp/apache2-error.log
CustomLog /home/danube/rls/myinnateapp/apache2-access.log combined
</VirtualHost>

Vag

On 9 Οκτ, 11:04, Hamza Khan-Cheema <hamz...@gmail.com> wrote:
> Hi,
>
> I have made a simple blog engine with innate and I want to deploy it to
> passenger.  But I can't seem to find much documentation on what to put in
> the config.ru file.  How to deploy a Ramaze app is in the manual :
>
> http://www.modrails.com/documentation/Users%20guide%20Apache.html#_ra...

Hamza Khan-Cheema

unread,
Oct 10, 2011, 4:32:37 PM10/10/11
to ram...@googlegroups.com
Thanks for such a complete answer.  I will try that in my config.ru file.

Hamza
Reply all
Reply to author
Forward
0 new messages