Reputation: 11719
I'm looking for a good configuration of rails + a webserver. Actually I'm using webrick which has some problems (on 2 different machines): First, it crashes after XXX time (and it's not my application, it happens randomly on a brand new app). Second, it doesn't handle multiple requests, and my app uses a lot of small ajax calls making the website testing really slow for being on a local server with so small pages.
I thought I could install Rails + Apache but reading around I think it's not possible. What's the fastest configuration (that supports multi threaded requests) as a webserver to use with Rails?
I'm using wamp to handle my apache webserver, php, mysql and so on (yea I'm not an expert, but I can handle with configuration files). I would like to use rails through that apache if possible, I read I should use however apache + mongrel (can I handle multiple requests in this way?).
I'm ok with other configurations too, I just need someone to point me in the right direction and possibly on a tutorial.
So requirements are:
Thanks a lot
Edit 1:
For those who like me uses virtual hosts, here is what I wrote:
<VirtualHost *:8080>
ServerAdmin [email protected]
DocumentRoot "D:/wamp/www/manage_federtrek_org"
ServerName federtrek.org.localhost
ServerAlias manage.federtrek.org.localhost
ErrorLog "logs/manage.federtrek.org-error.log"
CustomLog "logs/manage.federtrek.org-access.log" common
ProxyPass / http://manage.federtrek.org.localhost:3000/
ProxyPassReverse / http://manage.federtrek.org.localhost:3000/
</VirtualHost>
Where port 3000 is mongrel server and 8080 is apache port. Follow the pdf document linked in the answer to make it works.
Upvotes: 0
Views: 355
Reputation: 5301
Webrick is not appropriate for a production environment; it should only be used for local development.
You're deploying Rails on Windows? Never heard of that being done before. If it were Linux or OS X and you insisted on using Apache, I would recommend Fusion Passenger (it's kind of like Ruby's mod_php). But I don't think they support windows.
I think your best bet is Mongrel...I think it runs under Windows. The idea is that you run one or more copies of your Rails app as Mongrel processes (services in Windows parlance?) You then setup Apache as a reverse-proxy to them, perhaps also doing some load balancing. While it's not actually multi-threading, it will have the same benefits. (In fact, most Rails deployments use this idea instead of true multi-threading.)
Should be lots of tutorials out there for this, on *nix at least. I think most of it will be the same for Windows. A quick Google search yielded this PDF specific to a Windows setup. http://www.napcsweb.com/howto/rails/deployment/RailsWithApacheAndMongrel.pdf
Upvotes: 1