The Lamp/Wamp/Xamp/Mamp stacks are all capable of making your sites public.The benefit here is that you can share your site outside of your network, but you still have to deal with ugly ip addresses, which may change due to your internet service provider. It also makes your computer a bigger target to hacking attacks. We noticed around the web that there were very few quick, straight-shooting tutorials on how to set up multiple Wordpress sites on MAMP Pro. We also noticed that many people were having trouble doing this. Hopefully this quick guide will help. Please comment on our website if you are having any troubleshooting issues. We noticed around the web that there were very few quick, straight-shooting tutorials on how to set up multiple Wordpress sites on MAMP Pro. We also noticed that many people were having trouble doing this. Hopefully this quick guide will help. Please comment on our website if you are having any troubleshooting issues.
In this tutorial, you’ll learn how to install and run WordPress MultiSite on a MAMP webserver. Running multiple sites from a single installation simplifies and streamlines administration, and serving it all from a locally installed version of MAMP gives you everything you need to develop your network of sites for the Web.
WordPress enables you to create multiple websites from a single installation, requiring only one database and one set of files for thousands or even millions of sites. But it does require some tweaking and experimenting to really get the hang of WordPress MultiSite, so doing it on a live server may not be for everyone. Fortunately MAMP enables you to set up your very own local server environment in a matter of seconds on your Mac OS X machine. This is perfect for setting up WP MultiSite and developing your sites safely and securely behind the scenes.
Requirements
- Knowledge needed: WordPress, familiarity with Apache, MySQL, PHP
- Requires: WordPress, MAMP, Mac OS X (version 10.4.0 or later)
- Project time: 1 – 2 hours
If you’re not a Mac user, check out these _AMP alternatives for setting up WordPress locally.
Getting Started
To set up your own local server environment with MAMP, visit their website and download the free version to follow along with this tutorial, or grab the Pro version for greater functionality and flexibility. Then of course you’ll also need the latest version of WordPress, which is currently at 3.5.1. You can grab the latest from WordPress.org/download. Note that MAMP requires that your Mac is running Mac OS X 10.4.x or better.
Once you’ve downloaded MAMP and WordPress, you’re all set for the tutorial, which guides you step-by-step through the process of installing and configuring MAMP and WordPress for local testing and development. Upon completion, you’ll have a robust, flexible, and secure platform for developing your own network of sites.
Overview – What, How, and Why
Before diving in, it’s important to have a solid understanding of how everything works, sort of like seeing the “big picture” of what’s happening. The first thing we’re doing is installing and configuring MAMP, which stands for Mac, Apache, MySQL, and PHP, and basically provides you with a fully functional server environment on your Mac computer. So instead of trying to do it “gorilla-style” and develop multiple WordPress sites on a live server, MAMP enables you to build and test everything from the safety and comfort of your local machine.
Then after setting up MAMP, you’re ready to roll tough with WP MultiSite, which gives you the power and flexibility to build and operate multiple sites from a single installation of WordPress. Setting up WP MultiSite requires a little more configuring than regular, single-site WordPress, and so getting everything working on a local server environment like MAMP is a smart way to maintain control over the entire process.
Mamp Multiple Wordpress Sites Download
That said, let’s start by installing and configuring MAMP, and then move on to setting up WordPress MultiSite. Along the way, we’ll provide some additional tips and tricks to help you get the most out of the experience.
Setting up MAMP
In the first part of the tutorial, we’ll install and configure MAMP on your local Mac machine. Once MAMP is set up and working properly, you’ll have a robust, flexible platform on which to develop and test anything that requires Apache, MySQL, and PHP. This alone is a powerful tool to have in your belt, and in the second part of the tutorial, you’ll learn how to set up WordPress MultiSite for virtually endless site-building possibilities.
Step 1: Installing MAMP
Once you’ve downloaded the latest version of MAMP, double-click the disk image and drag “MAMP” (not “MAMP PRO”) to your Applications folder. Note that you’ll need administrator permissions to install the MAMP software.
After installation, all of your MAMP files will be available in the Applications/MAMP
directory. To facilitate expediency, you may want to create a shortcut to the MAMP directory and/or the MAMP.app
application file.
MAMP also provides a handy Dashboard widget for direct control over your MAMP servers. To install the MAMP widget, copy the file Mamp Control.wdgt
from the MAMP directory to the Widgets directory located at ~/Library/Widgets
. The widget should work immediately when viewing your dashboard (see screenshot), but if it doesn’t you may need to reboot and/or double-click the widget file directly from the Widgets directory.
Step 2: Configuring MAMP
Once MAMP is installed, run the program by clicking the “MAMP.app” icon from the ~/Library/Widgets
directory. As MAMP opens, you’ll be asked “Do you want the application mysqld to accept incoming network connections?” Yes, you do want that, so click the “Allow” button to proceed.
Next, MAMP will open a browser window and go to the default Start page, located at http://localhost:8888/MAMP/
. As seen in the screenshot, the MAMP Start page contains a variety of resources, including a link to phpMyAdmin and your database connection parameters. Along the top of the page, you’ll find tabs for phpMyAdmin, XCache, and other major components. To create a local server environment, MAMP includes over 20 different programs, including eAccelerator, Zend Optimizer, Freetype, and many more. To see a complete list, visit the “FAQ” tab from the Start page.
In addition to the Start page, the application panel should also be visible after starting MAMP. As seen in the screenshot, the MAMP control panel enables you to Start/Stop the servers, Open the Start page, and set your Preferences. Clicking on the “Preferences” button brings up an options panel that provides some basic server settings. Let’s go through each of these settings and optimize our MAMP configuration for WordPress.
First, click on the “Start/Stop” button and check all of the options, as seen in the screenshot. Also notice that we can set an alternate URL for the MAMP Start page if desired.
Next we want to change the server ports from MAMP defaults (8888 and 8889) to Apache and MySQL defaults. To do this, click the button that says “Set to default Apache and MySQL ports”. This will set the Apache port to 80 and the MySQL port to 3306, which are both standard web-server port numbers.
Lastly, click on the “PHP” button and review the default settings, and then do the same for the Apache settings. For WordPress, the default settings for both of these options panels are going to work fine, so there is no need to change anything for this tutorial. Just know that they’re there, so if later on you decide to change something, you know where to do so.
Step 3: See it working
So MAMP is installed, and you can check functionality by creating a simple index.html
file and adding something like <h1>Hello World</h1>
. Then put the file in MAMP’s /htdocs/
directory. Then open a browser tab to http://localhost/
to get a basic idea of how MAMP is working. The /htdocs/
folder is like the root directory of your local site, and its URL is http://localhost/
. We now have all we need to set up WordPress MultiSite.
Setting up WordPress MultiSite
With MAMP installed, configured, and ready to go, it’s time to install WordPress and set up MultiSite. WordPress provides a powerful, flexible framework for building websites, and with its MultiSite functionality, a single installation of the software enables you to create an unlimited number of websites using a single database and one set of files. It’s really powerful stuff, so learn more and get it for free at WordPress.org.
Step 1: Installing WordPress on MAMP
After downloading the latest version of WordPress, unzip the contents and move them to MAMP’s /htdocs/
folder. After the files have been moved, locate the wp-config-sample.php
file in the root directory (htdocs), and rename it to wp-config.php
. Then open the file and enter the following database connection settings:
Once you get the database credentials dialed in, save the file and navigate to the MAMP Home Page in your browser. Click on the “phpMyAdmin” tab (near top of page) to open phpMyAdmin, which is basically an user-interface for the MySQL database. On the first page that appears in phpMyAdmin, there’s a field for creating a new database (see screenshot). Using the default settings, simply type “wordpress” in the “Create new database” field and click the “Create” button to create the database.
After the database is created, open a new browser tab to the WordPress installation page at http://localhost/wp-admin/install.php
. Here you will specify a Site Title, Username, Password, and Email address. After filling them in, click the “Install WordPress” button to do so.
At this point, WordPress is installed and you should see the “Success!” message appear on the page. You’re now ready to set up MultiSite and begin your local website development on MAMP. Click on the “Log In” button to log into WordPress to get started with MultiSite.
Step 2: Setting up MultiSite
With MAMP and WordPress installed, it’s time to set up MultiSite, which enables you to create an entire network of sites. As we go, keep in mind that MultiSite is powerful stuff, and there are a LOT of settings and functionality involved. A complete guide to WP MultiSite is beyond the scope of this tutorial, but you can find all the gory details at the official Create a Network page in the Codex. In this part of the tutorial, we cover the basic requirements for setting up and running WordPress MultiSite locally on MAMP.
Begin the set up process by opening your site’s wp-config.php
file from the /htdocs/
directory. Here we will define the MultiSite parameters near the bottom of the file. Just above where it says, “That’s all, stop editing! Happy blogging”, add the following line:
With that code in place, visit the WordPress Admin and click on the newly added “Tools > Network” item. On the “Create a Network of WordPress Sites” page, check that everything is filled in correctly and then click the “Install” button to create your network of sites.
Note: In this tutorial, sub-directories are required for sites added to the network. To use subdomains instead, refer to this guide: WordPress MultiSite Subdomains on MAMP.
After clicking the “Install” button, the Network page will display the remaining steps required to complete MultiSite installation. For the sake of completeness, we’ll go through each of these steps and explain a little further about the purpose of each.
First create a directory named blogs.dir
in your /wp-content/
folder, such that its path looks like /htdocs/wp-content/blogs.dir/
. The blogs.dir
folder is where WordPress stores uploaded media for your network of sites. This directory must be writeable by the web server.
Next open your wp-config.php file from the root directory, locate the line that says define('WP_ALLOW_MULTISITE',true);
, and place the following code beneath it:
These definitions are automatically generated and required for MultiSite to work. Note that a certain amount of customization is possible by tweaking these definitions, should you decide to experiment later on.
Lastly, create a blank file named .htaccess
in your /htdocs/
directory and add the following code:
If somehow you find any existing WordPress rules in your root .htaccess file, replace them with this code (see this post for more details).
Upon completion of these three steps, WordPress MultiSite is enabled and configured. Returning to the Admin Area in the browser, WordPress will require you to log in again. After doing so, click on the new “Network Admin” link in the upper-right corner of the screen to create, configure, and manage your Network of sites.
Next Steps..
WordPress MultiSite opens the door to endless possibilities, and there’s a LOT of cool features and functionality that you should explore by simply navigating through the Network Admin area. To create and add a new site to your Network, click on “Sites > Add New” menu item and fill in the blanks. To view and manage individual sites, click on the “Sites > Sites” menu and hover over any site on the list. As you hover, a variety of options will appear, enabling you to Edit, Deactivate, Archive, Spam, Delete, Visit the site, or go to its Dashboard.
As you develop locally, don’t forget to keep backups of your work. Using a Mac, you’re probably covered using Time Machine or similar, but if you ever just want to grab a complete backup of your entire local server, it’s easily done with a quick copy of your /Applications/MAMP
directory.
Conclusion
In this tutorial, we’ve seen how to set up WordPress MultiSite locally on MAMP. Following the steps in this guide, you can create a powerful, flexible developing platform and host all of your sites with a single installation of WordPress.
Went to my first Wordcamp in NYC this weekend! Funny enough, one of the first people I met upon entering the conference was @karmatosed, whose Buddypress Theme Development book I had just downloaded for offline reading on my Safari Books Online mobile app. (I had *literally* been reading it on the subway just a few minutes before I met her. :D) So many accomplished WordPress developers at this conference.
Anyway, this post is about how I learned to set up multiple local instances of WordPress on my macbook air WITHOUT using MAMP Pro (go Vagrant!), thanks much to @DrewAPicture, a web engineer at 10Up and contributor to WordPress and to VVV. He helped me figure out “what’s next?” after the setup instructions in https://github.com/Varying-Vagrant-Vagrants/VVV left me hanging.
I thought the instructions in the initial README were great for getting my first http://local.wordpress.dev site set up. But what if I wanted to set up another instance? Below are my notes.
STEPS FOR CREATING ANOTHER LOCAL WP INSTANCE:
0. Create a new folder in vagrant-local/www. For example: vagrant-local/www/name-of-your-project/
1. In your VVV/database folder, change the file name of init-custom-sample.sql to init-custom.sql.
2. Inside vagrant-local/database/init-custom.sql, create the databases. For example:
4. In vagrant-local/config/nginx-config/sites/, create servers.conf. This is where you’ll configure your nginx. If you have multiple dev instances, you’ll have multiple server{ } blocks. For example:
Setting Up Multiple Wordpress Sites Using MAMP Pro ...
5. In your terminal, make sure the vagrant IPs are added to the bottom of your ~/etc/hosts file.
Make sure:
… is added to the bottom of the hosts file.
Type exit to get out.
6. Run vagrant provision in your terminal so that the databases changes are registered.
7. Download wordpress in vagrant using the command line.
How To Use Mamp
exit to get out of vagrant.
8. Navigate to http://name-of-project.dev in the browser to create a new wp-config.php file, and follow the steps.
Your database host should be localhost, and the user and password should be associated with what you input in step #2. In this example, the user and password are ‘wp’ and ‘wp.’
9. You should now be able to see your local wordpress installation at http://name-of-project.dev/!
Installing Wordpress On Mamp
10. In practice, it’s better not to use version control on the core WordPress docs. You can git init inside vagrant-local/www/name-of-your-project/wp-content/themes/your-own-wordpress-theme to use version control specifically on your theme.