Creating a WordPress MultiSite Network on Linux (CentOS 6)

This post is part of a step-by-step series on installing WordPress on Linux (CentOS 6)

A WordPress MultiSite installation gives you the ability to make more than one WordPress site using one installation directory (though each site has its own upload media directory). You can allow anyone to make a WordPress site from your WordPress MultiSite, or restrict that ability only to the super admin.

Requirements

  1. WordPress has been fully installed and configured
  2. Setting up Pretty Permalinks in WordPress:
    1. Using htaccess and mod_rewrite
    2. WITHOUT htaccess

Modify wp-config.php

Go to your WordPress root site directory where you will find wp-config.php.

[ahmed@amayem ~]$ sudo vi /var/testblog/wp-config.php 

My blog was installed in /var/testblog/. Go to the bottom by entering G. Go up a bit till you find /* That's all, stop editing! Happy blogging. */. Add the following above it:

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );

For more on copy pasting in vi check here.

Exit with Esc or ctrl+c and then save with :x.

Changing Your WordPress Site into a MultiSite

Enter your wp-admin. If you are already in it then you will have to refresh the browser. Under Tools you should find the Network Setup option. Click it and fill in the details. Choose between sub-domain or sub-directory. The difference will look something like this:

  1. Sub-domain: newSiteName.yourdomain.com
  2. Sub-directory: yourdomain.com/newSiteName

Once you install it a new screen with configuration code will appear that we have to add to wp-config.php and .htaccess files.

Updating the wp-config.php file

Go back to the wp-config.php and paste the new snippet instead of the last snippet you added.

Updating the .htaccess file.

If you decided to setup Pretty Permalinks using .htaccess then update the .htaccess.

Updating the httpd.conf file

If you decided to setup Pretty Permalinks without .htaccess, then you will have to update the httpd.conf file:

[ahmed@amayem ~]$ sudo vi /etc/httpd/conf/httpd.conf 

Enter the following to search for the directory specific configurations

/<Directory

The first one will probably be the following:

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

Press n to go the next occurrences. If you find one that looks like this:

<Directory "/path/to/your/blog/root">

Then you are in luck and just need to paste the new snippet under it. Otherwise add the following:

<Directory "/path/to/your/blog/root">
    Paste your snippet here
</Directory>

Exit insert mode using Esc or ctrl+c then exit and save by entering :x.

Now we need to restart apache:

[ahmed@amayem ~]$ sudo apachectl restart

Checkout your Dashboard

Now just check out your dashboard (if you are already logged in then refresh the page) and you will notice that there is a new my sites option at the top left. Time to play around, making new sites and posts. You can also map your new wordpress sites to actual domains outside your own domain

References

  1. Official WordPress Create a Network Codex

Ahmed Amayem has written 90 articles

A Web Application Developer Entrepreneur.