Combining Multiple Sites into One


Though not as standard as the previous steps, the multiple site combination is definitely a method to consider. The time requirements needed to complete all the steps for the branching method can sometimes take hours. Installing multiple sites and sharing some table data, even with cleanup of unneeded files and tales, should rarely take longer than an hour. Combining a couple simple sites might require no more than a few minutes to get up and running fully. You can begin with the following virtual server configuration.

Web Server Configuration

There are multiple installs of PostNuke in this method, so you need to configure your web server a little differently. Each of your domains need to look to the different installs. Here's an example of how this is done in the Apache httpd.conf file:

 <VirtualHost *> DocumentRoot /var/www/pets ServerName www.familypets.com </VirtualHost> <VirtualHost *> DocumentRoot /var/www/dogs ServerName dogs.familypets.com </VirtualHost> <VirtualHost *> DocumentRoot /var/www/forums ServerName forums.familypets.com </VirtualHost> 

IIS users will need to use Windows Server 2003 in order to host the multiple sites. If you need to run a Multisites installation under Windows XP, using Apache's httpd web server is recommended.

PostNuke Install

Install PostNuke normally into each of the prepared root directories defined previously. Use the same database name for each.

Documenting Table Changes

Now, you need to confirm which tables will be sharing their information with which installs. An easy way of documenting this is by expanding the draft in Table 25.2. Add the table name and mark what is shared or private. You can ignore areas that will universally not be shared. The familypets example is shown in Table 25.4.

Table 25.4. Documenting Table Shares

RESOURCE

TABLE

WWW

DOGS

FORUMS

Comments

_comments

Shared

Shared

Shared

FAQ

_faqanswer

Shared

Private

Shared

FAQ

_faqcategories

Shared

Private

Shared

Groups

_group_membership

Shared

Shared

Shared

Groups

_group_perms

Shared

Shared

Shared

Groups

_groups

Shared

Shared

Shared

News

_stories

Shared

Shared

Shared

News

_stories_cat

Shared

Shared

Shared

News

_topics

Shared

Private

Shared

Permissions

_user_perms

Shared

Private

Private

Settings

_module_vars

Shared

Private

Private

Stats

_stats_date

Shared

Shared

Shared

Stats

_stats_hour

Shared

Shared

Shared

Stats

_stats_month

Shared

Shared

Shared

Stats

_stats_week

Shared

Shared

Shared

Users

_user_data

Shared

Shared

Shared

Users

_user_property

Shared

Shared

Shared

Users

_userblocks

Shared

Shared

Shared

Users

_users

Shared

Shared

Shared


Editing pntables.php

Complete sets of pntables.php files are in each install. Based on the tables you want to share, edit the appropriate tables files to reference the mutual tables.

Open the pntables.php files in your editor and look for the table definitions that begin like this:

 $faqcategories = $prefix . '_users'; 

The shared table prefix should replace the variable call so the separate install is forced to use a different table for that module.

Following the familypets example, the dogs install's references should look to the nuke main site for users. The prefix "nuke" would be hard-coded into the table reference like so:

 $faqcategories = 'nuke_users'; 

Make similar changes to each table you want shared. You do not have to base the changes on one primary site. Site1 might share tables with Site2, while Site3 shares tables with Site2 and Site4. Any combination is possible.

Removing Unneeded Tables

Use the chart you made with the shared table names similar to Table 25.4 to determine which database entries can now be deleted. Use your database management tool to clean up your shared database.

Now, your sites are linked. Yes, it's that simple.



    PostNuke Content Management
    PostNuke Content Management
    ISBN: 0672326868
    EAN: 2147483647
    Year: 2003
    Pages: 207
    Authors: Kevin Hatch

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net