Setting up WordPress Multi-Site

By Joe Gardiner Monday, 9th August 2010

Wordpress-dark

WordPress 3.0 integrates the old WordPress MU (Multi User) version into a single version that supports multiple sites on multiple domains on a single WordPress install.

Your CatN vCluster makes an ideal platform for running a WordPress blog farm. If you're looking for unlimited domains (including vanity domains!) from a single WordPress installation, this guide will get you up and running in no time.

Note: This guide only applies to WordPress version 3.0 and above.

This guide is dependant on you installing WordPress in your root directory, not in a subdomain. e.g. install WordPress in your www/sites/fubra-customer/http folder


Getting Started

Unzip your downloaded WordPress install to a folder on your desktop.

Open the newly unzipped WordPress folder, locate the file called "wp-config-sample.php", and rename it to "wp-config.php".

screenshot of renaming wp-config.php file for WordPress

Open the newly named "wp-config.php" in you text editor and locate the MySQL Settings section.

database settings in a wp-config file

You need to open your vCluster setting page to retrieve your database information which is available on the CatN Control Panel: https://passport.fubra.com/site/cat/login/.

After the 'DB_NAME' field, enter your username exactly as it appears in the Database Settings page, as this is the same as your database name.

After the 'DB_USER' field, enter your username.

After the 'DB_PASSWORD' field, enter your Database password. Note: This is different to your Access password, and can be changed in the Database Settings screen.

After the 'DB_HOST' field, enter the server name in the Database Settings screen. eg. xserve1.dc.fubra.net.

You can ignore the two remaining fields, ('DB_CHARSET' & 'DB_COLLATE').

The multi-site rule

Adding wordpress multi site rule to a wp-config file

Scroll to the bottom of the wp-config file, and just after define('WP_DEBUG', false); add the rule "define('WP_ALLOW_MULTISITE', true);". This is a very important step, and you must make sure that it matches exactly the text in this guide.

I have also added comments above this rule, just to help me review this file quickly at a later date. You do not have to do this, but it is good practice to comment any code.

Once you have added the multi-site rule you can save and close the completed "wp-config.php", making sure you click 'Yes' when FileZilla prompts you to re-upload the file to the server. There may be a delay of a few seconds before this prompt appears so be patient, it's very important!.


1 2 3 4 5

Posted in Guides, Wordpress | 4 Comments » twitter-follow facebook-follow rss-follow

  • sean says:

    Hi

    Thanks for writing this guide and making it easy to understand by providing reader those screen captured. I am still facing some issue. So might need some advice from you. :)

    FYI, I am running a shared web hosting with hostgator. And i have no problem following all your steps but i need to ask a few questions to see where i have gone wrong…

    1) Under Supper Admin > Domain Mapping, do i need to enter the ip address of my server where my main blog is installed? or i just leave this section as default?

    2) My main blog is house881.com and my sub-domain blog is namlongseeds.house881.com. And under my root directory i have a folder for house881.com and also a folder for namlongseeds.com. Take note both house881.com and namlongseeds.com is on the same level.(under root directory)
    My question is, do i need a htaccess file under the folder for namlongseeds.com? If yes, do you know what is the code required.

    3) previously before i did the domain mapping, i actually use redirection instead. so i use the .htaccess file to do the re-direction. below is the code used:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^namlongseeds.com
    RewriteRule ^(.*)$ http://namlongseeds.house881.com/$1 [R=permanent,L]
    RewriteCond %{HTTP_HOST} ^www.namlongseeds.com
    RewriteRule ^(.*)$ http://namlongseeds.house881.com/$1 [R=permanent,L]

    My question is, if i follow your guide, am i right to say that there is no need for me to do re-direction on my webhosting anymore since the mapping is done using the plugin available in wp? If i am correct above, so am i right to say the above code in .htaccess is no longer needed?

    The reason why i am asking the above questions is because after applying your steps and removing the .htaccess, i got this errror page:
    Index of /
    Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.namlongseeds.com Port 80

    Would appreciate your kind advice. Thanks.
    Sean

  • Joe Gardiner says:

    Hi Sean,

    1) You can leave this field as the default.

    2) You do not need an .htaccess file in each of these folders, only in your root directory. However, my guide suggests you let WordPress handle sub-domains instead of mapping on a sub-domain you have created manually. I do suggest following this advice if you intend on creating a large network in WordPress, as the domain plugin will easily allow you to map domains quickly and simply, and mapping to domains created manually require .htaccess configuration, not covered in this guide.

    3) If you use the WP plugin for domain mapping to sites within your network then the .htaccess sample in the guide will work successfully, provided you use your Private IP from HostGator.

    There is a difference between the subdomains created by WordPress when you make a new site in your WP network, and the sub-domains you can create manually in your HostGator filesystem. It is important these two methods do not get confused. The network in this guide was created with WordPress in the root directory.

    I hope that has helped.

  • sean says:

    Hi

    Joe, thanks for your explanation. I have got it working. My mistake was that my new domain directory is not pointing to the root directory where my wordpress is installed. Once i changed that, it works!

    But the images on all my post is not appearing. (show a small cross instead of the image) FYI, I have selected the default setting for my permalinks settings. Not sure if you can advice what could be the issue?

    Thanks.
    Sean

    • Joe Gardiner says:

      Hi Sean,

      Glad to hear that helped.

      There could be a few reasons you are having problems. Try to not use full urls, for example:
      <img src=’http://www.yoursite.com/images/Logo.png’>.

      Use this instead:
      <img src=’<?php bloginfo(‘stylesheet_directory’);?>/images/Logo.png’>
      to make the image location relative to your stylesheet.

      Thanks

      Joe

Leave a Reply

Your email address will not be published. Required fields are marked *