Hacks

XOOPS Multi Sites

ldapguru  21-Jan-2004 22:03 10840 Reads   35 Comment(s) 
Here's a way in which you can run multiple xoops instances with 1 simple XOOPS install.

This would be benefitial for those running XOOPS hosting servers. (saves diskspace and you could control caching independently for each XOOPS instance)

Here's a Step by Step procedure to do it.

1. Backup your existing mainfile.php

2. Copy mainfile.php to <yourdomain>.mainfile.php
eg: if your domain is www.ldapguru.net then copy mainfile.php to ldapguru.mainfile.php

3. Replace your existing mainfile.php with the following code:
<?php
if (!(isset($serverName))) 

$serverName $SERVER_NAME
$serverName str_replace("www.","",$serverName);
$serverName str_replace(".com","",$serverName); 
$serverName str_replace(".net","",$serverName); 
$serverName str_replace(".org","",$serverName); 

if (!(empty(
$serverName))) 

include(
$serverName."mailfile.php"); 
?>


4. Thats it !!!

An example instance is as follows:
If you want to run 1 XOOPS instance against the following 3 domains
www.domain1.com
www.domain2.net
www.domain3.net

You would create 3 files
domain1.mainfile.php
domain2.mainfile.php
domain3.mainfile.php

You could customize each file with it's unique URL. You could either keep the same database parameters (XOOPS_DB_HOST) or have unique ones. You could also have just 1 database with unique prefixes (XOOPS_DB_PREFIX) for each site.

the functionality is similar to what i have running on one of my non-XOOPS servers.

http://www.rohanpinto.com andhttp://www.chriselda.com are the same server, same hosting account and same content with the above script enabled. Remember these URL's are not running XOOPS, but rather the exact same process.


If you do not want to hack the code but download it, visit my XOOPS site athttp://www.ldapguru.net, I shall be posting a Multi-XOOPS-Site download shortly.
Rating 0/5
Rating: 0/5 (0 votes)
Voting is disabled!


Login

Who's Online

235 user(s) are online (6 user(s) are browsing Publisher)


Members: 0


Guests: 235


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits

Categories