Skip to content

Instantly share code, notes, and snippets.

@chrisroos chrisroos/README.md
Created Apr 17, 2015

Embed
What would you like to do?
Configuring Apache, Passenger and Dnsmasq of Mac OS X

Configure Dnsmasq to respond to *.dev

Assuming it's been installed using Homebrew.

Add the following to dnsmasq.conf (/usr/local/etc/dnsmasq.conf).

address=/dev/127.0.0.1

Stop and start the service:

sudo launchctl stop homebrew.mxcl.dnsmasq
sudo launchctl start homebrew.mxcl.dnsmasq

Add a resolver

Create /etc/resolver/dev and add the following line:

nameserver 127.0.0.1

Add Apache Virtual Host

This assumes Passenger is already installed.

<VirtualHost *:80>
  ServerName gofreerange.dev
  ServerAdmin webmaster@example.com

  PassengerRuby /Users/chrisroos/.rbenv/versions/2.1.5/bin/ruby
  RackEnv development

  DocumentRoot "/Users/chrisroos/Code/freerange/site"
  <Directory "/Users/chrisroos/Code/freerange/site">
    Allow from all
    Options -MultiViews
    Require all granted
  </Directory>

  ErrorLog "/Users/chrisroos/Code/freerange/site/log/apache-error.log"
  CustomLog "/Users/chrisroos/Code/freerange/site/log/apache-access.log" common
</VirtualHost>

Restart Apache

sudo apachectl graceful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.