Set up virtual hosts for MAMP

2008 November 20
by cathy

If you use the free version of MAMP this is the simple way to set up virtual hosts -

in /private/etc/hosts add a line for each virtual host like:

127.0.0.1 vhost.local

Then, as described in Supercharge Your MAMP Environment, create a vhost conf file with an entry for each virtual host like:

<VirtualHost *:80>
    ServerName vhost.local
    DocumentRoot /Applications/MAMP/htdocs/vhost.local/
    <Directory /Applications/MAMP/htdocs/vhost.local/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>
 

The above works fine for a few sites that change infrequently, but quickly becomes a hassle to manage if you have many sites. The method posted on postmodern.com may be an option. It did not work for me.

I’m now using MAMP PRO which I’ll write more about in another post.

1 Comment leave one →
2009 June 19

Thanks Cathy! I will read your other post as well.

Leave A Comment

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS