Mongrelizing Ubuntu Edgy/Feisty/Gutsy/Hardy
Author: ceefour | Filed under: Beginner, Opinions, Praises, Rails, Ruby, TipsMy Kubuntu Edgy development machine is getting to feel rather slow with the “default” Apache2 + FastCGI setup. Alright, even though most pages never take any more than 0.5 seconds to load…
But still, well, although “refresh-driven-development” is getting more and more pushed out as replacements like test- and behavior-driven developments arrive, we developers still love our web browser anyway. Come on, all these fancy add-ons, extensions, and themes, now you aren’t going to see them again just because autotest? No way!
Mongrelification
So, in order to bring back the web browser inside your development cycle, get Mongrel:
sudo gem update --system # RubyGems 0.9.2 is here, please update first!
sudo gem install mongrel -y
To test it, go to your Rails project and do:
mongrel_rails start
Open up your web browser at http://localhost:3000/ and you should see your web site served pretty quickly.
Need help? Just:
mongrel_rails start --help
Upstartificating Mongrel
You need those freakin’-cool Mongrels to start whenever you boot. Ubuntu Edgy uses Upstart, a bit different than the Sys-V-Init that I never knew anyway.
We need to create some Upstart jobs. Create a text file named /etc/event.d/mongrel using root privileges (e.g. sudo vim /etc/event.d/mongrel) and put things like these inside:
start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5
stop on shutdown
script
mongrel_rails start -c /shared/rails/parlys -p 3011 -d
mongrel_rails start -c /shared/rails/cleanse -p 3021 -d
mongrel_rails start -c /shared/rails/medistic -p 3031 -d
end script
The above ‘job description’ will run three Mongrel instances, one for each active project I currently have, at ports 3011, 3021, and 3031 respectively. Ah, so glad!
Tip: Use –user and –group Mongrel command line arguments to specify the user and group your applications will run as.
Mongrel can be “integrated” with Apache, LightTPD (lighty), or any other web server. See Mongrel documentation for more information.
Technorati Tags: mongrel, ruby, rails, rubyonrails, apache, apache2, lighttpd, web, web2.0, web 2.0, server
UPDATE: Refreshing the information…
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.