I do not know why, but setting up stuff seems harder then it really is. I guess it does not help when you Google for answers, and all you get is information that is outdated, or way too complicated to understand. I hope to clarify things here. Here s my current setup:
Parallels Desktop 5
MAMP 1.8.3
Mac OSX 10.5.8
I wanted to use my local virtual hosts on my Parallels Desktop, so I can test my sites on Internet Explorer. It actually is really easy.
Setting Up A Virtual Host in MAMP1. Open Terminal
2. Type in:
cp /etc/hosts /etc/hosts.bak
This creates a backup of the file before editing it.3. Type in:
sudo mate /etc/hosts
Please note mate tells the Terminal to open the file in Textmate, use the command for your Development Software.4. Add the following to the file
127.0.0.1 *the virtual host name*
5. Save the file, and close it
6. Now type in:
cp /Applications/MAMP/conf/apache/httpd.conf
/Applications/MAMP/conf/apache/httpd.conf.bak
7. Type in:
mate /Applications/MAMP/conf/apache/httpd.conf
8. Add the following to the bottom of the file
NameVirtualHost *:80
<virtualhost>
DocumentRoot "/Document/Root/of/MAMP"
ServerName localhost
</virtualhost>
<virtualhost>
DocumentRoot "/Document/Root/of/first/project"
ServerName *the virtual host name*
</virtualhost>
Please note, only add all the above if you have never setup a virtual host on MAMP. To add to the existing virtual hosts, you will only need to add the following:
<virtualhost>
DocumentRoot "/Document/Root/of/first/project"
ServerName *the virtual host name*
</virtualhost>
I usually use projectname.local for the virtual host name.
9. Restart MAMP
10. Open a browser, and point to the virtual host that you setup. You should now see your local website.
Setting Up Parallels1. On your Mac, click the Apple > System Preferences > Network, and jot down your IP Address
2. Open Parallels, and click Start > Run. Enter this command:
wordpad c:\\windows\\system32\\drivers\\etc\\hosts
3. Add this to the bottom of the file:
*Your IP Address* *Your Virtual Host*
For Example:
192.168.1.2 myproject.local
4. Repeat for all Virtual Hosts
5. Save the File
Now you should be able to access your virtual hosts through Parallels. Happy Coding.