How to Set Up a Killer WordPress Testing Environment Locally


If you're a heavy WordPress developer like me, you might find that you need to create a new installation for each site that requires a strange structure or specific posts, instead of using your uniform local test WordPress installation. Cue WordPress Mu. WordPress Multi User is a platform created by the geniuses at Automattic that is basically a WordPress installation that allows multiple blogs to run using the same software.

In this tutorial, I'm going to show you how to set up WordPress Mu locally so that it can be viewed in VMWare Fusion too, a piece of software that allows for cross-browser testing on Microsoft XP and Vista. Mac only, sorry, however I'm sure something similar can be done with the PC versions of MAMP.


Unfortunately this tutorial requires a few paid things, so it can get expensive. You'll need MAMP PRO, Microsoft XP and VMWare Fusion- Only MAMP PRO is essential if you don't need to cross-browser test. MAMP PRO has some functionality on MAMP that we need when defining our new developer site. Download WordPress MU as well, we'll need that!

Note: MAMP PRO comes with MAMP- just stick both of them in Applications because you need the two.

Run Down

OK, so if you don't know completely what we'll be doing, I'm going to break it down further. If you use WordPress to develop your websites, then each time you create a new website you need to download a new installation of WordPress, install it, and go through that entire process just for a new site. This takes time AND hard drive space. What we'll be doing, is setting up a type of WordPress installation that allows you to use the same WordPress files, and set up a new WordPress site via wp-admin instead of going through the famous 5 minute install.

At the end of the tutorial you'll be able to visit to see your local WordPress MU installation. You'll also be able to open the same page in VMWare Fusion, which will be running Windows XP. This means you'll be able to see it in ALL major browsers- IE5.5-8, Chrome, Safari Mac, Safari PC, Firefox Mac, Firefox PC, etc. The list goes on.

Step 1 - Changing Ports on MAMP PRO

Once you've installed MAMP PRO, open it up and the servers should start running. We need to change the ports. Ports are basically the 'door' that a server tells the browser to go through. You might be familiar with CPanelX's port 8082. CPanel has told your server that to get to the CPanel, you need to go through door 8082. By default, MAMP PRO likes to have it's own ports- 8888 for apache and 8889 for MySQL. We need to change this back to the default settings. You can either turn it to 80 / 3306 manually or simply click 'Default Ports'

MAMP PRO will then tell you that the servers need to restart in order for changes to take effect. Click OK and let it do it's thing. If it tells you that Apache's failing to restart, check that 'Web Sharing' is un-ticked in your Sharing Prefs pane. You should now be able to visit http://localhost:80 to see either the 'If you can see this page Apache is successfully installed' page or the default MAMP index page. Great.

Step 2 - editing httpd.conf

httpd.conf is what Apache reads when it looks at what hosts or URLs to run on. You can find httpd.conf in ~/Applications/MAMP/conf/apache/httpd.conf

Scroll down to the very bottom, and you will probably find this:

<VirtualHost *>
	DocumentRoot "/Applications/MAMP/htdocs"
	ServerName localhost

or nothing at all. We are going to add this, or change it to the following code. We'll also be adding our own Virtual Host, which will be (Just a side note, when doing this it's important to never pick a URL that will conflict with an actual site, because while the settings are like you'll never be able to visit your local site's url online. e.g. if I set my host to be, would always resolve to my local machine as opposed to online). So like I said, add this (or change the default one)

<VirtualHost *>
	DocumentRoot "/Users/YOU/"
	ServerName localhost

<VirtualHost *>
	DocumentRoot "/Users/YOU/Sites/"

Don't forget to change YOU to your user name. This will also require a restart of the Apache and MySQL servers. You'll probably notice that doesn't exist in your sites folder- so create it!

Step 3 - editing /etc/hosts

This file, hosts is the configuration for exactly that, the hosts. So httpd.conf set the hosts for your mac! This requires some Terminal work, but I promise you it's as easy as copying and pasting the command, and then typing a single line!

Open Terminal (it's in Utilities in the Applications folder) and type:

sudo pico /etc/hosts

And hit enter. sudo means it's an admin action, pico is the Terminal's editor (which you'll soon see) and /etc/hosts is the path to what we want to edit. You'll be prompted for your password, so type it in. You should now see this screen:

That last line may or may not be there- if it isn't don't worry we'll be changing it anyway. Put the cursor at the bottom (clicking doesn't work) and where that last line of code is, change localhost to It should read: is the computer's way of saying 'me'. Save the file by pressing ctrl+o (o for write out and then ctrl+x to quit pico.

Step 4 - Adding a host for MAMP PRO

The final piece of the puzzle is to create a host alias in MAMP PRO. Now that the hosts are all set up, we need to tell MAMP PRO that it's actually there. In MAMP PRO click on the 'Hosts' tab. You need to add an alias. Click the little plus in the bottom left. You need to set a few things. Server name:, port: 80, Disk Location: /Users/YOU/Sites/, and add an alias in the bottom right of

Click apply, and once again restart the servers

Step 5 - WordPress MU

Grab your wordpress-mu Download and rename it to Stick it in your sites folder. Hey presto, you can go through with the installation! Unfortunately I found no easy way to use sub-domains on a local server, so I just stuck to sub-folders as the structure. Great! You can now use WordPress mu on your local computer! Go ahead with the 5 minute install, and then you can add blogs under the 'Admin Menu'. I wont go too much into the actual functionality of WPMU, but I'll explain how I use when working at the end.

VMWare Fusion

I'm not going to go into depth on this topic, because there are many tutorials on it. I will however explain how to modify a brand new installation (even if you've used it for ages there probably isn't a lot that will have changed anyway). Start up VMWare Fusion, and activate Unity if you so please. Unity allows you to run Windows XP windows natively in your mac- see screenshot below!

Step 6 - \etc\hosts (windows)

The /etc/hosts file in XP needs editing too. You can find it in C:\Windows\system32\drivers\etc\hosts. Open it up with Notepad, and we're about to put our line in. We need to grab an IP address first. Open a new terminal window and type ifconfig -a. You will get a whole lot of junk back- scroll down a bit until you can see 'vmnet8'. Grab that IP address, the one I've highlighted in the image below.

Then go back to your \etc\hosts file in windows, and at the bottom, paste that IP address in followed by

Step 7 - flushdns

Sadly, windows needs to be slapped for it to noticed that a change has taken place, so you now need to open Command Prompt. It is in Accessories in the start menu. Simply type ipconfig /flushdns. What this does is flush all the DNS names (localhost mainly) so that it recognises the updated hosts file.


You are now able to visit your MAMP running WordPress MU installation on every windows browser there was- looks like I have a bit of work to do!

A practical use for it

So as promised, I said I'd tell you how I use it. What I've done is gone ahead and downloaded every browser I need/support and installed it into my XP install. This way I can compare my WordPress sites window beside window and easily have access to modify whatever I need to, without having to save it and refresh an online installation!

Take a Wrap

So there you have it. The ultimate guide to the ultimate WordPress setup. It feels like I haven't put enough emphasis on WordPress MU itself, but it is just an install tutorial. WordPress MU saves loads and loads of disk space by taking all your separate WordPress blogs and putting them into 1- you have a universal theme folder/manager which makes it super easy to quickly swap between editing sites.

Related Posts
  • Code
    Web Development
    How to Use New Relic With PHP & WordPressRelic retina preview
    Today we will look at how to monitor a PHP application using New Relic. More specifically we will set up a basic WordPress installation and get some performance data about it, in the New Relic dashboards.Read More…
  • Code
    Web Development
    Easily Deploy Redis Backed Web Apps With DockerDocker wide retina preview
    Learn how to setup and deploy a Redis powered Python web app using Docker.Read More…
  • Code
    Setting Up a Local Mirror for Composer Packages With SatisComposer retina preview
    Installing all your PHP libraries with Composer is a great way to save time. But larger projects automatically tested and run at each commit to your software version control (SVC) system will take a long time to install all the required packages from the Internet. You want to run your tests as soon as possible through your continuous integration (CI) system so that you have fast feedback and quick reactions on failure. In this tutorial we will set up a local mirror to proxy all your packages required in your project's composer.json file. This will make our CI work much faster, install the packages over the local network or even hosted on the same machine, and make sure we have the specific versions of the packages always available.Read More…
  • Code
    Tools & Tips
    Using BrowserStack for Cross-Browser TestingBrowserstack retina preview
    Browser testing is the bane of our existence. Well, that's a bit of an exaggeration, but not by much. Multiple browser versions and browser fragmentation can make it difficult to get good test coverage for your sites especially when you factor in the different operating systems developers use to build with. Over the years, we've relied on a variety of tools to help us with this challenge including virtual machines, tools that simulate browsers and even having multiple devices on hand to work with. It'd be great if there were a way to have one viewport that allowed us to easily test across any major browser and their individual versions without jumping through hoops. aims to offer this via it's browser-based virtualization service and in this article we'll cover the service and how it helps tackle the cross-browser testing problem.Read More…
  • Code
    Modern WordPress Workflow for Professionals: RationaleVagrant logo 400
    Here on Wptuts+ we've covered a number of different workflows that people use when developing for WordPress. WAMP on Windows, MAMP on Mac, or XAMPP for either. Today we're going to explain some of the problems with these methods, and show you a new approach.Read More…
  • Code
    JavaScript & AJAX
    Going Live With NodeGoing live with node retina preview
    In my previous article I talked about my joy of discovering the Express framework. Express is what makes me feel like I could really build something with Node and have fun doing it. And in fact - I did that! I built some sample web apps and had a lot of fun. But eventually I decided it was time to buckle down and get serious. I liked Node, I loved Express, and if I was really going to commit to learning it, then why not take the final step and actually create a real website using it. Another thing I learned early on during my Node education (Nodacation?) was that having to stop and restart a Node app was a real pain in the rear. I had great success using Nodemon by Remy Sharp. It will notice updates to your code and restart your Node app automatically. This sounds trivial I suppose, but for me my entire experience with Node was at the command line. I'd simply run node app and test away on port 3000. I really didn't know what it involved to get that same application up and running on a real server and responding to a domain. In this article I'll describe two different attempts I made to move a Node app into production. Obviously there's more ways (and look for more articles here at Nettuts+!) so keep in mind this is what I tried and had success with. Read More…