Multi-Site Manager

Multi-Site Manager (MSM) is an stand-alone application that will let you deploy multiple websites with single installation and central point for maintaining and patching your installations. Instead of doing an install process for each and every Vivvo website, using MSM you'll be able to deploy an installation with just a few clicks and later on patch or upgrade all installations at once.

Multi-Site Manager schematic

Requirements

For individual installations standard requirements apply. Requirements for running Multi-Site Manager are:

  1. Server running WHM & cPanel v11.x or newer, under Linux or FreeBSD
  2. Root or at least reseller account for WHM/cPanel
  3. Either cURL extension or fsockopen() enabled in your php, plus file_get_contents() function has to be enabled, too.
  4. Access to linux console on your server, as root user (or as user with privileges to use sudo command).

Please note that Multi-Site Manager heavily relies on cPanel API, and therefore will not work on servers without cPanel and WHM.

Optionally, if you wish Vivvo MSM to access WHM/cPanel API over secure (SSL) connection, your cURL or fsockopen() needs to have SSL support enabled in php.

Installation

Main installation files

Please note that MSM bundle does not ship with Vivvo installation itself! You will need to deploy your own Vivvo installation files.

  • vivvomsm.pm: Custom cPanel module in charge of cloning/spawning Vivvo installation files
  • init_vivvo.php: Script that helps configuring automatically your Vivvo installations
  • conf.base.php: Basic configuration for you Vivvo installations
  • vivvo_msm.zip: Vivvo Multi-Site Manager bundle

Step 1: Upload and prepare files on *nix server

Make sure you can login to your server as root user, or at least as a user with sudo privileges. You need to login to console (command prompt), you will probably do this by accessing your server over ssh connection.

1. Upload standard Vivvo installation files, vivvomsm.pm module, conf.base.php and init_vivvo.php scripts to your server (using FTP or sFTP)

2. Move vivvomsm.pm file to /usr/local/cpanel/Cpanel/ directory

If you are working as root user, and you are in the same folder where file is uploaded, command to do this is:

# mv vivvomsm.pm /usr/local/cpanel/Cpanel/

(if you are a regular user with sudo privileges, just add sudo command in front)

3. Go to Vivvo installation files, open for editing file conf.php (it's empty), and insert the following lines in the file:

<?php

require 'conf.local.php';

?>

Save the changes.

Please make sure there is no space or empty lines after ?> tag, as it might create php errors.

4. Move your Vivvo installation files to /usr/share/vivvo directory, and make sure this directory and it's content are readable by everyone, but only root can write to it (privileges should be 755 for directories, and 644 for files).

You can do this as root user with:

# mv /path/to/Vivvo_CMS_files/ /usr/share/vivvo/

5. Now move files conf.base.php and init_vivvo.php to folder you've just created: /usr/share/vivvo/

As root user you can do it like this:

# cp conf.base.php /usr/share/vivvo
# cp init_vivvo.php /usr/share/vivvo

6. If your database is not on the same host as your web server, you will need to change value of VIVVO_DB_HOST in conf.base.php. You can edit the file on the server with following commands (of course, instead of Vim editor you can use whatever editor you prefer):

# cd /usr/share/vivvo/
# vi conf.base.php

or you could have edit it before uploading it to the server. In this file you can also change the settings for prefix Vivvo will use for database tables, but since each instance of Vivvo will be given it's own database, this setting is not of big significance.

Step 2: Install MSM

Now we will install Vivvo MSM, this part doesn't require root access.

1. Create a new account/ website for Vivvo MSM (it's easiest to do it from cPanel), and assign it a (sub)domain so that you can access the site.

2. Unpack vivvo_msm.zip archive on your local computer

3. Find file named cp_config.php in newly unpacked folder. This is the file with basic configuration used for accessing cPanel, so open it in your favorite editor, and adjust the settings to suit your needs. The settings have comments explaining them, but here are the few most important ones:

  • VIVVO_MSM_HOME_DIR : this is the location where user directories are created when using WHM to new create accounts. Usually it's folder /home/ (eg. if there is a user foo, her files will be located in /home/foo/ ), but might be different depending on your setup
  • VIVVO_MSM_DB_HOST : host for database that will be used by Vivvo MSM, usually it's localhost
  • VIVVO_MSM_SECRET : this setting is used for creating security hashes, you should enter some random characters there, and try using both small and upper case letters, digits and other characters.
  • VIVVO_MSM_CP_DOMAIN : the URL used to access WHM/cPanel
  • VIVVO_MSM_CP_PORT : the port used for WHM, usually it's 2086, or 2087 for SSL connection
  • VIVVO_MSM_CP_LOGIN : username used to login to WHM, this will be either root, or username of reseller account. This user has to have privileges to create, edit and suspend user accounts, in order for MSM to be work!
  • VIVVO_MSM_CP_ACCESS_KEY : cPanel remote access key, you can find this in WHM panel, it's located under 'Setup Remote Access Key' option in menu. It acts like a password, but for cPanel API. Please be careful to paste this value correctly, since it's pretty long and it's easy to cut off a part by accidence.
  • VIVVO_MSM_USE_SSL : allows you to set if you want to access WHM over SSL connection. It requires SSL support to be enabled in php for cURL or fsockopen functions. False by default, since most of the systems don't have SSl support enabled by default. If unsure about this you can leave it false, since cPanel API is called only on localhost, it's reasonably safe even without SSL.

All other settings are used to fine tune various default cPanel options for new accounts that are created for Vivvo sites (do they have FTP, email, etc..), if you need to adjust these please consult the inline comments in the file itself.

3. Once you've finished editing the settings, use FTP or sFTP to upload all unpacked Vivvo MSM files to webroot of the site created in the step 1.

4. Make sure the privileges on uploaded files are as follows:

  1. All files should be readable by everyone (so that web server can access them). This means that settings for files should be 644, and for folders 755.
  2. Following folders, and all their sub folders need to be writable (permissions 777) by web server: backup/, cache/, files/
  3. File conf.php has to be writable (permissions 666) by web server

Most of the FTP clients will allow you to change these settings using the GUI, but if you prefer using the command line, you can do it like this:

# cd /home/name_of_msm_site/public_html/
# chmod -R 777 backup/ cache/ files/
# chmod 666 conf.php

Of course, instead of /home/name_of_msm_site/public_html/ you should use the actual path to your webroot.

If you are familiar enough with web server administration feel free to adjust the file permissions as you find appropriate for tighter security, by limiting write permissions just to web server, or with advanced setups eg. with suExec mechanisms. Just keep in mind that files and folders listed above need to be writable by web server for Vivvo MSM to work.

5. Once this is all set, direct your browser to domain assigned to Vivvo MSM site in the step 1, and you should be redirected to Vivvo MSM installer wizard that will ask you a few additional questions and then will generate conf.php file for you.

6. Once installation has successfully finished you should remove installer folder from your webroot (or at least block access to it), and also remove write permissions from conf.php file, that is set file's permissions to 644 (so that only owner can write, and others can read it).

7. Last step is to add a cron job that will run the php script disk_usage_cron.php, located in the webroot of the site. This script is used to get disk usage statistics for Vivvo instances, you can run it once a day. To run this script add this command to your cron: php -f /path_to_webroot/disk_usage_cron.php

(where '/path_to_webroot/disk_usage_cron.php' should be substituted with the actual absolute path to this script in your website's root folder)

You can now login to your new Vivvo MSM by pointing your browser to domain assigned to Vivvo MSM, you will be prompted for admin username and password that you selected in installer in step 5.

SELinux: You will need to disable SELinux, in order for cPanel API to work properly. Also, sometimes suphp and suexec are reported to cause problems. In case this happens, switch to Apache mod_php instead of CGI.

Using MSM Administration

Upon successful log-in you'll see the main administrative panel on top - it serves you for fast access to account, user and plug-in management.

Main Administrative Menu

  • Home icon → Takes you back to the administrative panel home page
  • Accounts → Leads to the account management section that will be described later in this document
  • Users → Go to user management panel and add users that can access Vivvo MSM administration
  • Help icon → If you need assistance or information on Vivvo Multi-Site Manager administration you can choose help icon and you'll be taken to this document

For the most part Vivvo MSM Administration is the same as dashboard in Vivvo CMS Control Panel: http://wiki.vivvo.net/user_manual/administration

Product Information box contains information about the Vivvo MSM version you have installed and the latest release of Vivvo MSM

Product Information

You also have two boxes Website statistics and System statistics which contain current information on accounts, users and resources.

Website and System Statistics

Creating New Account

Creating new account will actually deploy new Vivvo website with separate configuration, database, files (images, etc.) and templates.

Choose Add new account link or choose Accounts on main administrative menu to go to account management and then click Add new account button. You'll be taken to the account creation page.

On the left hand side of the screen choose account status - account can be Active or Inactive. If an account is inactive the suspended message will be displayed on the screen when someone tries to access this website.

Add new account

  • Domain → Domain or sub domain for the website you're creating
  • Email → Enter e-mail address of the account's administrator (used for various notifications)
  • License → Each account/website has its own license key
  • Username and Password/Retype password → Administrator for the website

Click on Save when you are done.

open_basedir restriction: Make sure you turn off Open_Basedir in php_ini, otherwise you won't be able to create a new account using MSM.

Managing accounts

Choose Accounts from main administrative menu to access account management section.

Use Search tab to find an account using Email, Domain and/or Status as search criteria.

All existing accounts are listed on the right-hand side of the screen.

Accounts list

Each account on the list has status icon on the left, selection checkbox next to it followed by cPanel account name and e-mail address associated with the account in the first row, and website URL, account status and disk usage in the second row.

Use this section to manage accounts you previously created - reorder accounts list, edit or delete an account or change its status.

Suspending / Deleting account

You may change status and delete accounts one by one or in a batch using checkboxes and targeted action from Select action drop-down menu.

When you suspend an account its content, files and templates are kept in the database/server but this website is inaccessible and it shows suspended account message. The website will not be disrupted in any way and the account can be reactivated anytime later.

If an account is not needed any more and will not be used in the future you should delete it and all data associated with this account will be also removed.

Vivvo MSM Users

Choose Users from the main administration menu to go to user management section.

In this section you can add and manage Vivvo MSM user accounts in a similar way you would do in Vivvo CMS: http://wiki.vivvo.net/user_manual/users_edit

Note that these are users for accessing Multi-Site Manager interface, not individual Vivvo websites.

Performing patches and upgrades

All Vivvo installations controlled by Vivvo MSM use the common set of core files located in /usr/share/vivvo/ folder. You can upgrade or alter all installed instances of Vivvo at once by updating these core files.

Each instance of Vivvo has it's own copy of templates and themes (to allow for customization), so if you upgrade theme or template set, all new sites created will include these fresh files, however existing installations will need to be updated manually one by one.

 
devdoc/msm.txt · Last modified: 2010/03/01 04:49 by boccio
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki