When considering a multisite network for your clients you need to ask yourself two questions:

 

1) Who are my clients?  

 

2) How do they currently use WordPress?  

 

Asking these two questions will help you the developer, designer or agency to

determine whether or not multisite is going to be the ideal solution for your clients.

A major advantage of a multisite network is that you are working with only one

instance of WordPress which means that updates to the WordPress core, themes and

plugins will be managed more easily.  So today I would like to discuss how to set up

multisite locally so you can explore all that multisite has to offer. In this tutorial I will

review the process for creating a local site through MAMP and then jump into setting

up your very own local multisite network.

So let’s get started!  

 

SETTING UP MAMP

 

1) Setup MAMP

– Create a directory ( < your-directory > ) for your WordPress installation.
– Make sure MAMP is pointed to the directory you just created
– Created your database in phpMyAdmin
– Make sure the Apache port is switched to 80 and MySQL 3306.

2) Configure the hosts file

 -  Terminal sudo nano /etc/hosts
 -  Add ‘127.0.0.1 
 -  Save and exit

3) Edit ‘httpd.conf’

  - Terminal  sudo nano  /Applications/MAMP/conf/apache/httpd.conf

– Look for:

          # Virtual hosts
          # Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

– Remove the ‘#’ in front of the “Include” and save the file.

4) Adding Virtual Hosts to the VHOSTS file

  - Terminal sudo nano /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
  - Copy and paste into the file:
             <VirtualHost *:80>          
                    ServerAdmin webmaster@your-directory.dev
                    DocumentRoot “/Applications/MAMP/htdocs/"
                    ServerName your-directory.dev
                    ServerAlias your-directory *.your-directory.dev
             </VirtualHost *:80>

At this point you should be seeing the famous five minute install screen which means you are ready 

 for WordPress installation.  You are probably having issues with MAMP and the

port settings.  Follow these steps:

1) Launch MAMP

2) Open MAMP and click on ‘Reset MAMP Ports’ and change them back to the defaults, then click ok.

3) Switch to terminal and type sudo apachectl stop

4) Restart MAMP

5) Open MAMP and set APACHE and MySQL ports to 80 and 3306

6) Switch to terminal and type sudo apachectl restart

7) Switch back to MAMP and you should be good to go.

Not seeing the famous five minute install?

If you are still having issues with the MySQL ports, make sure to open your ‘Activity Monitor’

and quit any instances of MySQL. If you are still having issues restart your

computer and follow steps 1 through 7 again.

Setting up Multisite…finally

I’m assuming you went through the five minute install and are now running a

WordPress installation. If not please do so before continuing.

1) In your text editor open up to the ‘wp-config.php’ file and look for:

 /* That’s all, stop editing! Happy blogging. */

Above that comment you type define(‘WP_ALLOW_MULTISITE’, true);

Save the wp-config.php file and head back to your WordPress admin.

2) Once logged in scroll down to Tools > Network Setup.

After clicking ‘Network Setup‘ you will see the following screen:

 

 

This is where you will create your network. Since we are setting up the multisite network locally

make sure to select ‘Sub-directories’ as the Sub-domains option requires you to have a wildcard DNS

record.  Go ahead and click install

3) You should now see the following image:

Copy and past the first block of code into your wp-config.php.

Next head over to your .htaccess file and replace the rewrite mod rules with the new ones provided

in the ‘Enabling the Network’ screen.  Initially when I did this I ran into an issue with the copy and

paste method so  I deleted the .htaccess
file, created a new one and pasted in the fresh code.

When I attempted the process a second time I
was able to straight copy and paste from the original

file with no issue.  Next, log back into  the WordPress admin.

If you did everything correctly you should see the “My
Sites” with a drop-down and to the right of it

you should see the name of the first network you created.

 

The first time I set up the multisite network it took me quite a bit of time.

The second time I set up
the multisite network it took me about five minutes ( thankfully 🙂 ),

which included creating a virtual
host and installing WordPress. The setup is relatively straight-

forward  after the initial hiccups are 
resolved.

 

Thank you for reading.

mojomarketplace banner lightning talk

bluehost banner lightning talk

 

Share This