boxen / puppet-dnsmasq

Install the dnsmasq DNS forwarder.
http://boxen.github.com
MIT License
9 stars 29 forks source link

Help instructions #10

Closed sporkd closed 7 years ago

sporkd commented 10 years ago

Please help! The only documentation I can find to get this working seems to be here. Here's what I've done so far...

First I have a simple rack app called myapp which I can start successfully with thin on it's default port.

Then, inside the myapp.pp project manifest:

boxen::project { 'myapp':
  ruby          => '2.0.0-p247',
  dir           => "${boxen::config::srcdir}/myapp",
  source        => "gituser/myapp",
  nginx         => true
}

Running boxen then creates /opt/boxen/config/nginx/sites/myapp.config which wants a socket file:

upstream myapp.dev {
  server unix:/opt/boxen/data/project-sockets/myapp;
}

So instead of starting thin on it's default port, I try starting it on a socket which seems to work:

% bundle exec thin start -S "${BOXEN_SOCKET_DIR}/myapp"
Using rack adapter
Thin web server (v1.6.1 codename Death Proof)
Maximum connections set to 1024
Listening on /opt/boxen/data/project-sockets/myapp, CTRL+C to stop

However, when I visit http://myapp.dev nothing resolves and it never even hits nginx. I've tried restarting dnsmasq with boxen --restart-service dnsmasq and still nothing.

What am I missing?

sporkd commented 10 years ago

I made some progress on this and am leaving notes in case anyone has the same issues. After all this, I ended up switching back to Pow because I needed xip.io support, and it's just way more consistent.

  1. First issue was that I had installed then uninstalled Pow, but it did not clean up one of the firewall rules. In this case you need to remove rules manually:

    % sudo ipfw show 00100 88 12497 fwd 127.0.0.1,20559 tcp from any to me dst-port 80 in 65535 1287237 697372148 allow ip from any to any

    % sudo ipfw del 00100

  2. Next, ensure that /etc/resolvers/dev was created properly with the content nameserver 127.0.0.1
  3. Run these commands after every change:

    boxen --restart-service nginx sudo nginx -s reload (not sure why this is needed after a restart) boxen --restart-service dnsmasq

  4. Check that .dev resolver exists with scutil --dns. Use nslookup myapp.dev and dig myapp.dev for additional diagnostics.