
This is also true when using /Applications/MAMP/htdocs as by default it doesn’t contain a valid index file. Remember to place a valid index file – as defined by the DirectoryIndex directive – in this directory otherwise Apache will display the directory’s contents. This doesn’t have to be within the /Applications/MAMP directory.ĭocumentRoot "/Users/steve/Sites/000-default"Ī default virtual host configured to serve requests from the directory /Users/steve/Sites/000-default If you want files served from another location simply change the DocumentRoot and Directory directives. Options Indexes FollowSymLinks Includes execCGIĪ default virtual host configured to serve requests from the directory /Applications/MAMP/htdocs # 000-default ĭirectoryIndex index.html index.htm index.php To restore the original default behaviour we need to ensure the first virtual host configuration is configured as the default. If it’s unable to locate this configuration it uses the first virtual host configuration it finds. Now when Apache receives an http request in the form of a url it attempts to locate the matching virtual host configuration.

Once a virtual host has been configured this behaviour changes. By default this is /Applications/MAMP/htdocs. In a vanilla installation of MAMP without any virtual host configurations, Apache serves http requests for localhost from the directory defined in Preferences… > Web Server > Document Root. Type control + o then ↵ to save the file, then control + x to exit nano. # localhost is used to configure the loopback interface This is not as difficult as it may sound and can be accomplished fairly easily.Īs an example I’m going to configure a virtual host for a site that has a root directory of /Users/steve/Sites/mysite1 containing a simple index file and I’ll name the virtual host local.mysite1. The only real alternative is to get your hands dirty and configure virtual hosts manually.
#Uninstall mamp mac os pro
So, how are virtual hosts configured under MAMP? There is a Pro version of MAMP which allows easy configuration of virtual hosts but, unlike it’s baby brother, it’s not free. The most convenient and cost effective way to overcome this limitation is to use virtual hosts. This can prove inconvenient when developing multiple sites each requiring their own local host. However, out-of-the-box you’re limited to a single local host.


MAMP comes with Apache, MySQL and PHP and provides a local server environment independent of that installed as default on macOS. If you need to easily set-up and maintain a local server environment on your Mac then look no further than MAMP.
