
After the default localhost that you just created, add: # My custom hostĭocumentRoot "/Users/yourusername/path/to/your/site" Now you are ready to create your own VirtualHosts.

Personally I don’t use the htdocs directory a lot, but occasionally it’s useful to have somewhere to perform quick tests. This step is necessary to ensure that still points at XAMPP’s htdocs directory once we’ve created our custom VirtualHosts. Options Indexes FollowSymLinks Includes execCGI Towards the bottom of the file you will see some example VirtualHosts, which you should comment out or delete.Īt the bottom of the file, add ‘localhost’ as the default named VirtualHost: # localhostĭocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" Open the file /Applications/XAMPP/xamppfiles/etc/extra/nf. Include /Applications/XAMPP/etc/extra/nf Create your VirtualHosts Uncomment the second line by removing the hash ( #), so that Apache loads your custom VirtualHosts configuration file: # Virtual hosts #Include /Applications/XAMPP/etc/extra/nf Look for the following lines: # Virtual hosts The first thing you’ll need to do is open the file /Applications/XAMPP/xamppfiles/etc/nf in your favourite text editor. To test your development site all you would need to do is plug “” into your browser’s address bar. For example, you might want to map mysite.local to /Users/yourusername/mysite. You can set up as many VirtualHosts as you need, so that each website operates under its own hostname. VirtualHosts allow Apache to map a hostname to a directory on the filesystem. Here are the steps I followed to get everything running smoothly.įirst, some quick background on what we’re trying to achieve. Installing XAMPP was a snap, but when I came to create my own Apache VirtualHosts things started getting fiddly. While I know that MAMP is very popular on Mac, I have been using XAMPP for many years so I thought I’d stick with what I know. I do all my development locally, so one of the first applications I installed was XAMPP, a cross platform Apache/MySQL/PHP stack. You can find more information about NAMO here.A few weeks back I rejoined the “Cult of Mac” when I replaced my old Asus notebook with a MacBook Pro, and since then I’ve been busy settling into my new OS X workflow.
#Mamp vs xampp for mac pro#
NAMO is a local DNS that reads MAMP Viewer hosts from MAMP PRO and makes them available on the local network - using their real names, in any browser, not just the MAMP Viewer.
#Mamp vs xampp for mac mac#
If you are running on a Mac there is a great way around this “shadow host” problem. In this case we recommend using our local DNS Server App NAMO. Simple WordPress sites typically work, more complex ones might stop MAMP Viewer from showing a precise preview. And the more plugins a WordPress site uses, the more this fact interferes with the technique MAMP Viewer uses.

Unfortunately, this is exactly what WordPress does. This works quite well unless a web application itself stores the name of the host it is running on. So instead of MAMP Viewer going directly to a “mycoolhost”, it calls “mycallhostAtyourmachine.local” and the web servers of MAMP PRO make sure you still get “mycoolhost”. Preview your work using the MAMP Viewer available on iOS and Android.Īs most local networks do not have an easy-to-configure DNS (Domain Name Server) that you could teach about the hosts you want to preview, MAMP PRO uses the Bonjour networking technology (aka Zeroconf) and a feature we call “shadow hosts” to make up for the lack of real DNS entries. Restart your servers to enable viewing in MAMP Viewer. In order to make your individual host visible in the MAMP Viewer you must activate it on the Hosts > Settings > General Tab. MAMP Viewer can be found on the Apple App Store and Google Play Store. The MAMP PRO & MAMP Viewer combo is a great way of previewing your web sites on a mobile device.
