modrails: easy (if you are root)
Took a look modrails. First impressions: easy to set up; not sure what the target market is for this.
Here’s the setup for Ubuntu Hardy Heron:
sudo gem install passenger sudo apt-get install build-essential apache2-mpm-prefork apache2-prefork-dev sudo apache2ctl restart sudo passenger-install-apache2-module
Note that at this time passenger requires prefork. worker is not currently supported.
You have two choices when deploying: deploying to a virtual host’s root, or deploying to a sub URI. Both require modifying httpd.conf, having update access to the document root and restarting Apache.
At this point, I start to wonder what the point is. There already are plenty of options available to people with root access to their servers. What I would think would be most useful is something that targeted Apache shared hosts. I should be able to put something in my /home/rubys/public_html/.htaccess (or /home/rubys/Sites/.htaccess on a Mac) to say that the depot directory is a Rails application, and access it as http://localhost/~rubys/depot/. But instead I get
[Mon Apr 28 10:53:04 2008] [alert] [client 127.0.0.1] /home/rubys/public_html/.htaccess: RailsBaseURI not allowed here
I set it up on my web server recently, and one thing that pleasantly surprised me is that it didn’t seem that I had to set RailsBaseURI at all. This is probably because I already had all my Rails apps set up to run on subdomains, but I imagine that for a lot of shared hosting users this is already the case anyway. Dreamhost, for example, lets you set up as many subdomains as you want, which means that if they were running Passenger, people could just deploy their Rails apps to existing vhost roots, and it would automatically detect and run them.
Posted by Nat Budin at
Also, you don’t really need to restart Apache all the time once your stuff is configured. There is this hack about touching $RAILS_ROOT/tmp/restart.txt, which seems to work nicely.
Posted by Martin Probst at
As Martin said you can restart your application by touching tmp/restart.txt, I wouldn’t personally describe it as a hack, but you don’t need to be root.
It sounds like you’ve got some good ideas for the vhost support, I’d put bugs into their tracker. They’ve been pretty responsive with me so far.
Posted by Koz at
The point is first of all that it’s easier to set up and maintain, and secondly that you can host more smaller Rails applications on the same server while using less resources because you don’t have to keep mongrels or fcgi dispatcher processes running all the time.
Posted by Thijs van der Vossen at