Is it possible to get Passenger to work with DA?

mlchai

New member
Joined
Dec 8, 2008
Messages
2
I'd like to get Phusion Passenger working with DA, but I'm not sure how this would work. The document root for the rails app would have to be railsapp/public, but DA only seems to let the admin edit the VirtualHosts. Is there a way to let end users edit their own document roots or specify them for domains?
 
Wow, no one knows the answer? :( I've looked around and currently couldn't find anything on this...
 
I'd like to get Phusion Passenger working with DA

Why don't you ask the people who make Phusion Passenger. DirectAdmin is just a control panel that configures standard software.

Further I think you mean get Phusion Passenger working with apache. I admit I don't know anything about Phusion Passenger. But it sounds like it is a web application that needs apache to be configured a certain way. Using the templates you can have DA write whatever VirtualHost configuration you need.

Is there a way to let end users edit their own document roots or specify them for domains?

There is no secure host that will allow that.
 
I don't think it would be insecure if it were limited to directories inside the user's root directory.

Jeff
 
I don't think it would be insecure if it were limited to directories inside the user's root directory.

Jeff

That is true. But I take questions at face value and literally. I don't try to interpret what somebody meant and I am not a mind reader. He did not add any quantifiers in his question. I don't think he realized exactly what he was asking. But you are right if it were somehow limited to the user's home directory then that should be fine.
 
I got it to work with REE yesterday.

I must say, I've been playing around with all kinds of RoR setups over the years and this one actually feels great! In fact, it's so good we're developing a plugin for DA dedicated to mod_rails setups. Probably for internal use only, but who knows...

The great thing about it is that it's an Apache module. You won't need any other webserver than Apache, which is great as most DA users already run Apache. Passenger (combined with REE) will thus not only increase the speed of your RoR setup alone (take a look at the benchmarks), it will increase overall server performance (at least, I think it will).

Apart from that, the usability is great. You will never again have to start up an application, but simply upload your new files and issue a restart (touch tmp/restart.txt), which is much easier than the Mongrel/FastCGI approach.

The downside is that it's not as DA-friendly as I would have hoped. Well, actually, DA is not as RoR-friendly as I would have hoped. This is the first time I installed RoR on a server running DA and I've had some hick ups in the process. For example, you will need to edit the Virtualhost configuration to set your base URI and determine the mode your application is running in, which can normally not be done by users. Of course, an admin can add the appropriate lines to the user's httpd.conf from within DA (the only way DA will not overwrite it on updating), but you will not want the admin to have to set these things. Besides that, you also might want to change the documentroot to be able to launch your website from "/" without having to mess around with .htaccess. DirectAdmin prevents these kinds of changes in the user's httpd.conf.

But when I got it all to work, I was very pleased with the end result and I will most certainly consider using this setup as our main RoR development platform.
 
To expand on this, by the way: if, at this point, you wouldn't mind working with a symlink, the only thing you will need to add to the vhost is:

Code:
RailsBaseURI /rails # change to name of the symlink in your public_html
RailsEnv development # of course, change this if you want

The symlink will have to point to the public directory of your rails app.

Then, in your environment.rb file, you will need to change the relative url root to /rails using config.action_controller.relative_url_root.

Of course, you could then try using .htaccess to rewrite everything to /rails, but I'm not entirely sure whether that would work just that easily.

Another way would, of course, be to have DA use a different vhost template for RoR users, but that would limit the ability to use PHP and RoR at the same time. I'm still working on the best solution.
 
Old thread, but I just wanted to mention that setting up Passenger is a piece of cake once you've overcome all the problems with setting up Ruby properly (OpenSSL, UTF8, etc.) :D

You simply add this to the custom http config for the domain you want it enabled for:
RailsEnv production
PassengerHighPerformance on
|?DOCROOT=/home/user/domains/domain.com/public_html/public|
 
Back
Top