Skip to content

Instantly share code, notes, and snippets.

@akroii
Forked from hofmannsven/README.md
Last active September 3, 2015 13:37
Show Gist options
  • Save akroii/c979aa9136893f288d0c to your computer and use it in GitHub Desktop.
Save akroii/c979aa9136893f288d0c to your computer and use it in GitHub Desktop.
Update the hosts file in /private/etc/hosts to maintain multiple domains/hostnames on a local machine for 127.0.0.1 and setup a VirtualHost container in /Applications/MAMP/conf/apache/extra/httpd-vhost.conf via /Applications/MAMP/conf/apache/httpd.conf for a name-based virtual host.
sudo nano /etc/hosts
127.0.0.1 localhost
127.0.0.1 local.dev
# Include virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
# Name-based virtual hosting
NameVirtualHost 127.0.0.1
# Setup local.dev
<VirtualHost 127.0.0.1>
ServerAdmin info@website.com
DocumentRoot "/Applications/MAMP/htdocs/sites/website"
ServerName local.dev
DirectoryIndex index.php
<Directory "/Applications/MAMP/htdocs/sites/website">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment