Skip to content

Instantly share code, notes, and snippets.

@chrisroos
Created April 17, 2015 11:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisroos/1e44e37b0d5a5691cb2f to your computer and use it in GitHub Desktop.
Save chrisroos/1e44e37b0d5a5691cb2f to your computer and use it in GitHub Desktop.
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