Editing MAC's host file
You will first need to edit your operating systems host file, on a mac this is a rather simple procedure that you should be able to follow with ease.
- Open your terminal application (normally
/Applications/Utilities/Applications.app or you can may even perfer to use your standard text editor.
- In the terminal type
nano /private/etc/hosts or open that file using your editor.
192.168.1.1 example.com #Add a comment if you wish here to your hosts file, save it by doing control + o or save as within your editor.
- Now that your operating system hosts file has the nessacary changes you most likely need to flush your DNS by doing
Adding your virtual host
You then need to instruct your HTTPD server that you have a domain that you want to attach to the server, this is referred as a virtual host. In this example we look at Apache and setting a example domain (there is dozens of questions and answers on virtual hosts on Pro Webmasters already.
You can add the virtual hosts by going into your enabled sites and editing the configation file and adding something like:
Options Indexes FollowSymLinks Includes
Allow from all
It's worth mentioning there are plently of tutorials on YourTube which will work you through setting up a LAMP.