I wrote - http://invoker.codemancers.com/ for similar use. It provides easy to use `.dev` local domain support and then ability to manage multiple processes via a Procfile or custom ini file.
Thanks for this. Procfile support has been a thorn in my side with pow for ages.
Edit: Invoker doesn't seem to support the pow use case -- local configuration, not global. Inspired by the topic, I found https://github.com/riywo/anypow , which has a wrapper for non-rack applications, and can be used to make pow play nice with Procfiles.
I've been doing this for about a year or so now and its honestly the best solution for local development I've used in my career.
Recently I've started using Vagrant for more complex sites that require custom server software, or are based outside the traditional LAMP stack, but a Dnsmasq based setup on my mac is still my favorite for most sites.
It handles the .dev DNS resolution, and also supports hosting domains that you map through /etc/hosts (ex: foo.company.com if you need to share cookies with a SSO server, but don't want all of company.com directed to your local machine)
It is much easier to configure than Apache vhosts for distributing traffic based on host name:
* symlink to Rack app for Ruby support. Name of symlink becomes hostname
* create a directory and symlink Public for static HTML. Directory name is hostname
* as sibling said, put port # in text file to proxy traffic to another process. File name is hostname
I use Anvil for Mac to do some of my Pow management.
I'm also using Apache to do SSL termination and proxy to Pow, as well as host some other stuff. But Pow is so easy to use for both static sites and proxying to another web server, I prefer it.
I've been experimenting with this lately. I have been using dnsmasq to server up domains in my /etc/hosts file to local virtual machines for testing on different platforms without having to mess around with the hosts file in each virtual machine.
I am about to loop back around to a mobile project and I am hoping I can use it to tests my mobile app interactions with my local development box more easily than I have been able to in the past.
Another neat "trick" with dnsmasq is to redirect all the dns request for your domain to your dns provider when you're working with dns records (config needed: server=/example.com/176.124.112.100). Never wait for dns propagation anymore! Beat switching your system's dns to your provider because those could be slow for you, or could not answer domains that aren't in their database.
Or you could use ettercap to redirect all DNS requests for any device on your local network. That's how I test iPhone, iPad, and Android applications when the services needed don't have DNS entries: http://joseph.by/post/83414951259/effectively-edit-hosts-fil...
I do something similar with Ubuntu 12.04/14.04 which uses Dnsmasq via the NetworkManager service. These steps help make Dnsmasq a little more useful - reading /etc/hosts and allowing it to listen on your hosts IP address for use in guest VM's
One problem I've been running into: I have a virtual machine (linux running in vmware fusion on osx). I have dev.site.com in /etc/hosts. The vm is set to use a private network on the vm (as I don't want the ip address to change when I switch networks). How can I setup my phone to load dev.site.com and have it work while keeping the private network setup?
Manual: proxies all HTTP requests through a proxy server at the specified host and port.
Auto: uses JavaScript code hosted on a Web server at a specified (unproxied) URL to determine how HTTP requests get proxied. Assuming your proxy server is at host.example.com:8080, specifying a URL pointing to a file containing
function FindProxyForURL(url, host) {
if (shExpMatch(host, "*.vm.example.com")) {
return "PROXY host.example.com:8080";
} else {
return "DIRECT";
}
}
should proxy only HTTP requests whose URLs point to hosts in the .vm.example.com subdomain through your proxy server.
Disclaimer: I haven't tested any of this, and everything I know about proxy auto-configuration comes from skimming the Wikipedia page[1] just now.
Doesn't do the exact same (you'd have to add a new entry everytime, rather than point *.dev to localhost) but https://addons.mozilla.org/en-US/firefox/addon/hostadmin/ is easier to set up. It'll flush the dns cache everytime its changed.
No, you don't have to add a new entry every time, you just set it up and now absolutely.anything.dev points to localhost. When editing /etc/hosts you have to add a line for every hostname.
Great article for highlighting the dnsmasq on OSX idea. I wasn't aware that you could run this there.
On the goal of having unlimited easy to configure real domains that point to locahost, another service of interst is localtest.me [1]. This offers *.localtest.me -> 127.0.0.1
This is pretty useful! Maybe a noob question but how does this work offline / slow internet connections? I'm coding on the train pretty frequently and I hate waiting for urls to resolve... I'm guessing it's caching this DNS entry? (why would I otherwise have to run dscacheutil -flushcache...)
I think this is really useful when you combine it with vhosts on apache/nginx. On my linux machine I run something similar that allows me to serve static assets, run a local dev server (runserver/flask/unicorn, etc) and have a .dev domain to test with.
You can then combine this with xip.io and be able to share your dev site with others.
I read the article and just thought it's over engenering.
I wonder how many different web sites do these people have to configure on their laptops every week.
/etc/hosts offers no wildcard support. You can teach dnsmasq to route everything under the .dev TLD to localhost, so you can effectively create hostnames (including subdomains) by just using them.