Reminder to self: how to set up a virtual host for localhost webdevelopment on OS X with MAMP
- DNS setup: add an entry for the local domain name in
/etc/hosts, e.g.
127.0.0.1 foo.localhost
and flush DNS cache with
dscacheutil -flushcache
- Apache config (
/Applications/MAMP/conf/apache/httpd.conf): add a virtual host entry like
<VirtualHost *> ServerName foo.localhost DocumentRoot /Users/eddywally/Sites/foo/localhost-dev/drupal </VirtualHost>
and restart webserver, e.g. with
/Applications/MAMP/bin/apache2/bin/apachectl restart
-
Connect to
http://foo.localhost:8888(don't forget the nonstandard port number, unless you configured MAMP to use standard port 80).
further reading:
Post new comment