Topic: Mongrel, Apache, lighttpd, webrick

Ok so now I am really confused whith all these servers, options, configurations and ports.
I want to be able to run multiple rails apps in my local machine (running mac osX) but I am  lost whith all these different servers.
I was using webrick locally but then I downloaded typo and typo needed mongrel. Now i can't run typo nor the app I was working with. But I can run instiki with webrick. Adittonallny, I have a -broken- installation of lighttpd. This is making my head spin.

I am not really concearned now about the production server. I presume I can leave all that configuration to my hosting provider (I just signed up with site5, for the time beeing) What I want for now is the capability to run multiple apps at the same time without having to stop, waste time reconfiguring apache or installing yet another server. That would just make the learning procees easier for me. Download some code, run it, read it, rewrite it, run it again, jump to another app, repeat the process, jump back... you know how it is. I have not been able to do this so far.

Some light please.

Re: Mongrel, Apache, lighttpd, webrick

The easiest way to handle running multiple applications on a local host (and in some instances on a production server) is to specify an alternate port, ie 3000 (http://localhost:3000). Mongrel seems to be the most popular way of running rails apps right now. On Mac OSX you'd want to do this:

$ sudo gem install mongrel

This will get you mongrel_server which you can then call from your Rails app directory:

$ mongrel_rails start -e development -p 3000 -d

Most code examples are usually pulled out of the air and not tested. Use at your own risk!

Re: Mongrel, Apache, lighttpd, webrick

Thanks reedy. Mongrel is what i am using now for development.

Re: Mongrel, Apache, lighttpd, webrick

You could also make life a bit easier on yourself and set up some aliases in your ~/.bash_profile to save you typing all that stuff each time:

alias mstart='mongrel_rails start'

alias mstop='mongrel_rails stop'

alias mstartbg='mongrel_rails start -d'

alias mstartlog='mongrel_rails start -d | tail -f log/development.log'

Last edited by idlefingers (2006-08-06 08:00:36)

Re: Mongrel, Apache, lighttpd, webrick

can you not just use locomotive to run multiple apps and tap into whatever database you want? i know thing about server stuff, other than how to install and tweak some php things here and there...i just know locomotive has been working well for me, it throws off your origanization a bit but i am used to it.

Last edited by blinking8s (2006-08-06 09:20:52)


Re: Mongrel, Apache, lighttpd, webrick

Thanks idlefingers.
I added some aliases to .bash_profile but it seems to conflict with .bash_login. Whenever .bash_profile is present, I loose the path specified in .bash_login. Do you know what might be causing this?

blinking8s, I tried locomotive but it did not work well for me. I could not create new apps nor run existing ones. I didn' really try to figure out why either to tell you the truth. I just prefer building and installing everything just how and where I like it. I dont even like using darwin ports or fink. It is, of course a bit harder and I am no unix expert but I think in the long run is worth the effort.

Re: Mongrel, Apache, lighttpd, webrick

alce wrote:

I added some aliases to .bash_profile but it seems to conflict with .bash_login. Whenever .bash_profile is present, I loose the path specified in .bash_login. Do you know what might be causing this?

Try putting the contents of .bash_profile into .bash_login and deleting .bash_profile. I believe they both accomplish they same thing.

Last edited by ryanb (2006-08-07 13:55:51)

Railscasts - Free Ruby on Rails Screencasts

Re: Mongrel, Apache, lighttpd, webrick

That's rigtht, its just other way around. Specifing the path and the aliases into .bash_profile works. If you do so in .bash_login then  the path works but the aliases do not.
Thank you all.

Last edited by alce (2006-08-07 14:17:17)

Re: Mongrel, Apache, lighttpd, webrick

try typing 'source ~/.bash_profile' (in a shell window)

Locomotive sunk my battleship.

It completely trashed my lighttpd install. I know not many other people seem to have this issue, but I'd stay well away from it and do things manually. You get more control that way.

Last edited by idlefingers (2006-08-08 07:34:47)

Re: Mongrel, Apache, lighttpd, webrick

I use locomotive for local development on Mac OS X. It's incredibly easy to install and use. And you can simply quit the app when you're not developing to regain memory and free up CPU cycles.

Adding new Rails app is a simple as clicking a button, choosing a bundle and setting the port number. And it's a stand alone application. Just drag it into your applications folder and and drag to the trash to remove. If I remember correctly, Locomotive uses Lighttpd and FastCGI under the covers, but you don't need to manage the configuration by hand.

As for Mongrel, I've just deployed a Rails app using Mongrel Cluster, Apache 2.0.x and mod_proxy. Works well so far... [knock on wood]

Re: Mongrel, Apache, lighttpd, webrick

Here is a howto for rails, apache 2.2, mongrel, capistrano (mainly for production use): … o-and-you/

And here a howto for rails, mongrel, apache 2.0 on debian (I use this for production) … ian-stable

My homepage:
Working at:
My blog: soaked and soaped