views:

111

answers:

4

Hello folks, 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 =)

A: 

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

Azeem.Butt
could you be clearer?
rodrigo3n
When you installed Passenger you were given very clear instructions. If you didn't read them then then repeating them isn't likely to be a productive use of time.
Azeem.Butt
+4  A: 

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.

cwninja
A: 

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>
Bob Aman
A: 

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.

Ryan Bigg