MAMP and VirtualHostX make for an easy PHP development platform for your Mac. Both are compatible with Mac OS X 10.6 (Snow Leopard). Even though they are both simple to install and integrate, there are still some things you have to fix to make it work.
1. Turn off your Web Sharing in Applications > System Preferences > Sharing. Make sure the box is not checked next to ‘Web Sharing’.
3. Run VirtualHostX’s Setup Wizard
It’s a 2 step process. First, Backup your existing VirtualHostX settings (if you have them). Second, click the Make Changes button. This will allow the built-in Apache server and the MAMP Apache server share a virtual hosts file. It also will change MAMP to run off of port 80.
4. Configure VirtualHostX
Set VirtualHostX to use MAMP as the default web server. This makes the “Apply” button in VirtualHostX
5. Configure MAMP
Open up the preferences in MAMP, click on the “Ports” tab, and click “Set to default Apache and MySQL ports.” Then click “OK.”
6. Fix the phpMyAdmin
VirtualHostX hasn’t updated it’s configuration to work with the latest MAMP. So, when you run the Setup Wizard, it replaces a section of the Apache configuration with an incorrect configuration. Open /Applications/MAMP/conf/apache/httpd.conf in TextEdit, and replace this block:
Alias /phpMyAdmin "/Applications/MAMP/bin/phpMyAdmin" <Directory "/Applications/MAMP/bin/phpMyAdmin"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
With this block
Alias /phpMyAdminForPHP4 "/Applications/MAMP/bin/phpMyAdminForPHP4" <Directory "/Applications/MAMP/bin/phpMyAdminForPHP4"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> Alias /phpMyAdminForPHP5 "/Applications/MAMP/bin/phpMyAdminForPHP5" <Directory "/Applications/MAMP/bin/phpMyAdminForPHP5"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
7. Restart your MAMP servers (stop then start), and you should be good.
8. Add hosts in VirtualHostX
Click the “Add Host” button, enter the domain name and Local Path, make sure the Port is set at 80, then click “Apply Changes.”
Now simply navigate to “http://testsite/” in your web browser, and you’ll see your test site.