By

Installing WordPress 3.0 Multisite/Network!

This post covers the brand new multisite/network feature in WordPress 3.0, which was previously called WordPressMU (and was a separate project, the two have now been merged in WordPress 3.0). To follow along you will need to be running WordPress 3.0 or higher.

OK, so today I took the plunge and decided to install WordPress multisite, to allow a network of any number of blogs to be created, and all controlled from a central ‘Super Admin’ interface. Below is basically a walk-through of how I installed and configured the multisite network. I had been putting off installing it before as I thought it would be a pretty unfriendly and hard to set-up but I have to say that by the end I was pleasantly surprised to find out how easy it was to implement and set-up this great new feature of WordPress 3.0. So, sit back follow along with the install and then try it out for yourself!

To test out the new multisite feature of WordPress 3.0, I am using the latest version hot of the press – WordPress 3.0.1. This is hosted on a local server (WampServer 2.0 to b exact) and up until now I have been using this local version of WordPress as a traditional single blog whilst developing Plugins and themes.

Right, let’s dive straight in with installing WordPress multisite.

To kick start your multisite network install you need to click on the ‘Network’ menu item under the ‘Tools’ menu heading. However, you probably won’t be able to see it as it is hidden by default as you need to switch on this menu item by adding a line of code to your wp-config.php file. To do this simply open up your config file in your favourite code editor and add the following code.

define('WP_ALLOW_MULTISITE', true);

Make sure that you add it above the comment line /* That's all, stop editing! Happy blogging. */. Just save the config file and refresh your WordPress admin interface. You will now see a new menu link under the ‘Tools’ menu heading, as seen below.

Clicking on this new link will take you show you a warning message to deactivate all Plugins before continuing. So make sure they are all switched off for the time being, and click the ‘Network’ menu item again (you can reactivate all your Plugins again once the network installation is complete, and configured).

Just a quick note before continuing. You have two choices how additional blogs will be created/viewed. They can either be inside sub-directories relative to your main (default/original) blog, or as sub-domains. When running on a live server the choice is completely up to you but when using localhost as your web server you only get the option to use sub-directories (unless you look into advanced localhost configuration – by default the easiest choice by far is to stick with using sub-directories. This is the approach used in this post.

Next, you will see the screen shown below, where you will be able to install the network feature of WordPress. Enter the name of your network and the admin e-mail address, then click on the ‘Install’ button.

You should now see the ‘Enabling the Network’ screen as shown below. As you can see you are prompted to backup your wp-config.php and .htaccess files. Both of these files can be found in the root folder of your WordPress installation.

As pointed out above I am on a localhost server so all my additional sites in the WordPress network will use subdirectories. So, the first step is to create a blogs.dir folder inside the WordPress ./wp-content folder. This will be used to store uploaded media for my additional sites, and must be writeable by the web server.

Now, you need to make a couple of edits to both your wp-config.php and .htaccess files. Firstly, add the following to wp-config.php somewhere above the comment /* That's all, stop editing! Happy blogging. */:

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/wordpress-3.01/';
define( 'DOMAIN_CURRENT_SITE', 'localhost' );
define( 'PATH_CURRENT_SITE', '/wordpress-3.01/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

Next, replace the content of your .htaccess file with:

RewriteEngine On
RewriteBase /wordpress-3.01/
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

After that is done your network should be configured and enabled, and you will need to log in again as per the screen shot below.

For this test I am using the Twenty Ten theme, and when I logged in again I had a warning about Featured Images: The current theme supports Featured Images. You must enable image uploads on the options page for it to work.. This may not be relevant for every theme but if you need to switch it on the it is just a case of clicking on a checkbox in the network options page.

OK, so that is pretty much it for the installation! Pretty painless really wasn’t it? The only thing left to do now is to take the new network feature for a brief test drive and see how easy it is to set up a couple of additional sites on top of the main/default one. After you log in again you will see a brand new ‘Super Admin’ menu section appear directly above the dashboard menu, which is shown below.

To add a new site click on the ‘Sites’ menu item in the ‘Super Admin’ menu. This will show you the currently defined sites and also allow you to create new ones as shown below.

Just add in the new details for your new site (see the screenshot above for example data I used to create a new site), and click ‘Add Site’. Repeat this for as many sites as you like (I created two), and you will see something similar to the image below.

That is basically all there is to it for installation and setup. There are a ton of options and settings you can play around with for advanced configuration but for most things (at least to begin with you will just need to know how to access the backend of each site, for site specific administration. To do this, click on the ‘Sites’ link in the ‘Super Admin’ menu and then hover your mouse over the site you want to access, then click on ‘Backend’, as shown below. Here, you will have access to write/edit posts for each separate blog, control Plugins and themes and so on.

Finally, after adding two extra blog sites to the network I thought it would be interesting to take a look at the state of the database. As you can see below there are quite a few tables added for each site, so this may be a consideration if you plan to add a lot of sites on your network. I know there are a few articles around that deal specifically with the scalability of WordPress multisite, and so it might be worth digging around for that if it is relevant to your needs.

This is my first foray into WordPress multisite/network and has been a pleasantly simple affair – I am suitably impressed. There has obviously been a ton of work gone in to this feature to make it as slick and trouble free as it is so the development team definitely deserve recognition for that.

I can basically sum it up by saying that installing, and configuring it it is a snip, and that it just.. well.. works! Simple as that. No nasty surprises or headaches or hours trawling through solutions for weird errors etc. :)

I am sure I am going to be delving deeper into the possibilities of this great new WordPress feature. So if there are any particular aspects that you would like to see discussed then let me know in the comments below.

12 Responses to Installing WordPress 3.0 Multisite/Network!

  1. Darcy Hill says:

    These are great instructions that were a HUUUGE help. Thank you so much!

    Quick question – I’ve set it up, and like you showed, WP basically walks you through what you need to change. The site I set it up on to test this with is fine, but I can’t get the sub-domains to show up (WP said I could only do sub-domains). Any ideas on where I might have screwed up?

    Thanks again for all your help. This was definitely much less scary than the WP site had me believe it would be!

    • dgwyer says:

      Difficult to diagnose from your description. I have only set up and tested WordPress multisite a couple of times so am still learning myself! The best place to find help is probably the multisite forums on WordPress.org:

      http://wordpress.org/support/forum/multisite

      • Darcy Hill says:

        Problem solved(-ish)! I needed to turn on wildcards for the subdomains to show up. Duh! =P

        Again, awesome post and it sure took the scary out of doing this. Thanks again!

  2. Excellent article. Thanks for writing this. I also like how WordPress hand holds you through the steps – every step of the way.

  3. Etienne says:

    Hi great post1

    I have tried to set up as suggested, but when I go the actual main site. None of the permalinks work.
    Any idea why?

    Thanks

  4. Emeka says:

    Really great effort!
    I was just wandering why you did not mention anything about how unique toplevel domains can be tied up to the individual minisites, have you any idea how this can be done in wordpress. – I means each minisite within the main blog directory having its own domain name.

  5. John says:

    Thanks for the articler, it helped greatly

    One question if I may, When you install it says to use the .htaccess in your WP install folder. I installed intp http://www.domain.com/wordpress bu there is no .htaccess in this folder only on the top root level Do I just use that .htaccess to add the wp code

    Thanks again

  6. Ryan says:

    Setting up a sub-domain install felt a lot like removing my eyeballs out with a toothpick.

    If anyone reading this needs assistance with this sort of thing, go check out http://musupport.net/ run by Andrea and Ron Rennick. They have ninja awesome support over there for multisite related issues. I didn’t find the site until AFTER I’d gone through the horrific ordeal :(

    Thankfully once you’ve got sub=domains up and running, shifting to a domain mapped setup is trivial :)

  7. Islam Muslim says:

    Thank’s for this (Installing WordPress 3.0 Multisite/Network!) great tutorials. I was having a hard time with those.

  8. Iyalarasi says:

    It is simply super article.
    I want clarify my doubt,and need help,After I rewrite my two files,when I click login button,I don’t know that which username and password I have to give?Is there any seprate username and password is there?When I login with previous username and password,It goes to admin and doesn’t show network admin?