PCI Compliant Web Hosting and Managed Service Provider
Hosting Solutions since 1995

How to setup WordPress MultiSite in H-Sphere

Author: ; Published: Nov 14, 2011; Category: Managed Hosting, WordPress; Tags: , ; No Comments

WordPress MultiSite allows you to manage one to many WordPress sites and blogs from one interface.  WordPress MultiSite provides a central location for upgrading WordPress, WordPress Themes, and WordPress Plugins.  Other benefits including saving database and site disk space.

Parallels H-Sphere (sometimes referenced as HSphere) allows hosting providers to automate the infrastructure across multiple servers.   In someways H-Sphere is like WordPress multisite in that you have one H-Sphere installation managing multiple servers from a central location vs. other automation systems which require a complete install of their software on each server with each server managed separately.

While this article maybe helpful to those not using Parallels H-Sphere, it is intended for H-Sphere hosting providers to use for the benefit of their customers.

After you install WordPress (using the normal, single site installation), edit wp-config.php to add the following:

 

define(‘WP_ALLOW_MULTISITE’, true);

 

Note: Make sure it’s just before the line /* That’s all, stop editing! Happy blogging. */

Next go to your WordPress Dashboard and under the tools menu you’ll see a new option called network.

Click on this and you’ll come to the install page for MultiSite.

Enter your desired name for the network, and the email of the account you wish to be the site admin, the account which will have total control over the network. If you enter the email of your current account, that account will be used, otherwise a new account will be made.

Also, as part of the installation you will most likely have to make the blogs.dir directory chmod 777 if you are using mod_php rather than fastcgi.

You’ll be given a code to add to both wp-config.php and .htaccess, is will look something very similar to the code below. Use the code WordPress provides you.

 

wp-config.php

define( ‘MULTISITE’, true );
define( ‘SUBDOMAIN_INSTALL’, true);
$base = ‘/';
define( ‘DOMAIN_CURRENT_SITE’, ‘www.sitename.com’ );
define( ‘PATH_CURRENT_SITE’, ‘/’ );
define( ‘SITE_ID_CURRENT_SITE’, 1 );
define( ‘BLOG_ID_CURRENT_SITE’, 1 );

 

.htaccess

RewriteEngine On
RewriteBase /
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).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

 

In terms of real life examples, I set up mmoblogging.com (shell site, no real blog / site here) to run factionalwarfare.info and evepiratelife.com blogs.  Here’s what the multisite portion of my wp-config.php looks like:

define( ‘MULTISITE’, true );
define( ‘SUBDOMAIN_INSTALL’, true );
$base = ‘/';
define( ‘DOMAIN_CURRENT_SITE’, ‘mmoblogging.com’ );
define( ‘PATH_CURRENT_SITE’, ‘/’ );
define( ‘SITE_ID_CURRENT_SITE’, 1 );
define( ‘BLOG_ID_CURRENT_SITE’, 1 );

After the installation and initial setup of WordPress MultiSite, install the WordPress MU Domain Mapping plugin.

Part of the installation will be putting the following in your wp-config.php file after the last define line multisite:

 

/** http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/ */
define( ‘SUNRISE’, ‘on’ );

 

Now for H-Sphere providers, as well as those automation systems that use similar methodologies, for each new site after the main site (which in my case is a pure shell — at least for now), you add a new domain name that has web services turned off (it is up to you whether you want email services, but mainly you just need the DNS services).

You want to make sure all new domain names that will be mapped (included) in the WordPress MultiSite are set up to point to the same IP address of the main site.

Once you have WordPress MU Domain Mapping plugin installed, go to your WordPress dashboard, settings, domain mapping.  There put in the IP address of your main site (in my case, it is the IP address for mmoblogging.com).  For the check boxes, check the following:

  • Permanent redirect (better for your blogger’s page rank)
  • User domain mapping page
  • Redirect administration pages to site’s original domain (remote login disabled if this redirect is disabled)

Then go to settings, domain, and add your sites.

You get the site id from sites, edit and look in the URL (web page address bar) to see the “id=” field and the site id is the number after the equal sign.

Do check primary for each site you add.

Now, for the manual part on the physical server running the H-Sphere logical service the main WordPress site is located.  SSH to that server, and become the root user (use sudo if you please). Then do the following:

cd /hsphere/local/config/httpd/sites
grep [main site domain name] *
vi [numeric id for domain].conf

Edit the ServerAlias line to include the following (all on the same line with host names separated by spaces):

        *.[main domain name] [site 1 domain name with www] [site 1 domain name] [site 2 domain name with www] [site 2 domain name]  (and so on)

Save the file, and restart the Apache web service.

Here’s what mine looks like:

ServerAlias *.mmoblogging.com www.evepiratelife.com evepiratelife.com www.factionalwarfare.info factionalwarfare.info

Once any DNS propagation is done, you should be able to visit the separate sites; and it should be transparent in that they are part of a WordPress multisite setup.

For administration, you log into the main site and where it states “Howdy, ___________” you left click and should be given the option to become the Network Admin.

Here you can install WordPress themes once for use with all of your sites.  Most, but not all, WordPress plugins are network aware, allowing you to install them once for access by all of your sites.

For the plugins that are not network aware, you can log into the individual site for installation.

Here are related sites I’ve found helping with setting up WordPress Multisite:

Dynamic Net offers fully managed hosting from shared to VPS to dedicated.  If you want us to setup WordPress Mulisite for you, please contact our support department.

Please contact us if you want more information on our services and products.

Peter Abraham
Former CEO of Dynamic Net, Inc. Will be transitioning to a new career in the near future.
Peter Abraham

@

Peter Abraham

Leave a Comment


eight − 5 =