If you do any Rack or Ruby on Rails development, you should checkout Pow, the zero configuration Rack server for OS X.
Pow makes getting up and running with these apps dead simple. No running
one app at a time, no Apache/Passenger configs to setup, no mucking with 1
rails server
. Pow doesn’t
require special privileges (runs as your user), with no gems or
extensions to intall. Just Pow, and it installs in seconds.1
/etc/hosts
From the manual:
How does it work? A few simple conventions eliminate the need for tedious configuration. Pow runs as your user on an unprivileged port, and includes both an HTTP and a DNS server. The installation process sets up a firewall rule to forward incoming requests on port 80 to Pow. It also sets up a system hook so that all DNS queries for a special top-level domain (.dev) resolve to your local machine.
###The good and bad: ###
You can configure that last one, and it’s simple to do so, incase you do any other type of development where you already have something like Apache setup to handle those requests. Without configuring otherwise Pow will respond instead and likely not know what to do.
###Setup and adding Apps###
Installation requires authentication simply because it creates a new Firewall rule.
It’s that easy. Uninstallation is just as easy too:
Pow creates a
directory in your home folder. To setup an app
with Pow, 1
~/.pow
there and create a symlink:1
cd
Done! Visit
and you’re rack app will load
before your awe-struck eyes.1
http://rackapp.dev
###But what about my port 80?###
Yeah, you probably want that back huh… Fortunately you have some options there, detailed on this helpful wiki on the Pow Github project. It outlines two steps, but depending on your desired setup, you may be fine with just the first one.
####Without adjusting Apache####
Create a
file and put the following there:1
~/.powconfig
On Boot, Pow will read that file for any configuration options (more here). This tells Pow not to use port 80, but instead use port 88.
From there forward, just add
to your app urls, a la
1
:88
. Apache will still use port 80 and your other
apps will be fine, while any Pow app now responds to
1
http://rackapp.dev:88
.1
<app-name>.dev:88
####Adjusting Apache####
If you like the idea of not having to specify a port at all, you can
do the additional step of adding an Apache conf file in
instructing Apache to act as a reverse proxy for
Pow instead. This allows you to have your Pow apps respond at
1
/etc/apache2/other/
, while maintaining your current Apache process.1
<app-name>.dev
The naming is important because Apache will load it last. You want Apache to behave like normal for all requests and then proxy anything that doesn’t match your other host files to the Pow server.
###A little Pow(der)###
Pow has already made your life better, what more could you want?
You’re right,
and creating a symlink is asking an awful lot of you just to run multiple Rack apps simultaneously with no hassle…1
cd ~/.pow
So you use Powder, a handy little gem that lets you link and unlink Pow apps without
leaving the comfort of your
. And hey, it can give you a bit more insight to what Pow’s doing too.1
cwd
###Epilogue###
Pow gives you really, really easy setups for your Rack apps. Now you can work on several at the same time or support interaction between them with ease. Coupled with one-line install/uninstall, the barrier to entry is incredibly low too, so give it a shot. It can make your (dev) life simpler.