rodrigo3n
rodrigo3n

Reputation: 123

How do I setup my Rails Apps to Run through Phusion Passenger?

I have the following doubt:

I have an application in Rails+MySQL and I want to run this with Apache + Passenger, I have both installed, but when I run ./script/server my app starts running with WebRick, how do I change it for work with Passenger and Apache?

P.S: I'm on Ubuntu 9.04 Jaunty Jackalope, please consider the fact I'm a newbie =)

Upvotes: 2

Views: 300

Answers (4)

Ryan Bigg
Ryan Bigg

Reputation: 107728

If you're running multiple apps on your own box (i.e. a development box) a friend of mine has got a gem that will help with the /etc/hosts writing called Ghost.

You can use it like:

sudo ghost add domain.local

And now in your browser typing domain.local will point to 127.0.0.1.

Upvotes: 0

Bob Aman
Bob Aman

Reputation: 33239

Passenger is more of an always-on type of setup. You don't use script/server to start it, because it automatically shuts down if you're not actively using it, and reactivates when you start using it again. I personally have an /etc/hosts entry that maps myapp.local to 127.0.0.1, and then I use Apache's virtual hosts to identify which Rails app to start.

<VirtualHost *:80>
  ServerName myapp.local
  DocumentRoot /apps/myapp/public
  RailsEnv development
</VirtualHost>

Upvotes: 0

cwninja
cwninja

Reputation: 9778

If passenger is installed (and the module is in apache), all you need to do is point an Apache VHost's DocumentRoot at your public directory. Passenger should take care of the rest.

There is no separate server to start, the app runs direct from Apache (just like mod_php, but without the cooties).

A more detailed explanation is available here.

Upvotes: 4

Azeem.Butt
Azeem.Butt

Reputation: 5861

You need to put it wherever you told Apache to serve it from. script/server will no longer be involved.

Upvotes: 0

Related Questions