Multi site setups

Multi site setups, a forum discussion on Jojo CMS. Join us for more discussions on Multi site setups on our General Discussion forum.

Back to Forum Index : Back to General Discussion   RSS
Jaijaz Jaijaz

23 Sep 2007
Posts: 215

Hey, does anyone know (Harvey;-)), how the multi site works behind the scenes.? Does it use the one database for all the sites? If there is one index.php file in the htdocs folder how does it know which site to serve?

Thanks,
Jai
If you not living on the edge you taking up too much space.
mikec

Lead Developer

mikec

24 Sep 2007
Posts: 67

Hi Jai,

Each site will have a separate database. Each site will have its own index.php and the generated config.php. The config.php includes the database config, and in the database is the address of the site to server.

Let me know if you need any more detail

- Mike
Jaijaz Jaijaz

24 Sep 2007
Posts: 215

Thanks Mike.

I am a little confused with the index.php and config.php files for each site. How do they all exist in one htdocs directory. I understand that each "mysite" directory exists in the directory a level up but don't follow what happens in the htdocs directory.

Thanks,
Jai
If you not living on the edge you taking up too much space.
Harvey

Core Developer

Harvey

24 Sep 2007
Posts: 327

Consider this fictionary folder structure...

/home/jojo/

/home/site1/www/
/home/site1/www/index.php
/home/site1/www/.htaccess
/home/site1/www/config.php
/home/site1/mysite/
/home/site1/mysite/plugins
/home/site1/mysite/themes
/home/site1/mysite/cache
/home/site1/mysite/downloads

/home/site1/www/
/home/site1/www/index.php
/home/site1/www/.htaccess
/home/site1/www/config.php
/home/site1/mysite/
/home/site1/mysite/plugins
/home/site1/mysite/themes
/home/site1/mysite/cache
/home/site1/mysite/downloads

So the jojo folder can go anywhere visible to the various installs. Each install has it's own www or htdocs or webroot or public_html folder. Each install has it's own mysite folder.

How you setup virtualhosts for each website depends on your server config. On a live server, you would point www.site1.com to /home/site1/www/ and www.site2.com to /home/site2/www/
On a WAMP or local server it's a bit different - I'm usually too lazy to setup virtualhosts so I run Jojo out of a folder instead. eg http://localhost/site1/ and http://locallhost/site2/

Does this help a bit?

Harvey.

Edit: is "fictionary" even a word? I'm pretty sure I meant "fictional". Too much coding lately and not enough fishing.
Jaijaz Jaijaz

24 Sep 2007
Posts: 215

Thanks Harvey.

Yeah totally get it now. Still very new at the setting up a live server, and have trouble thinking things through.

Thanks,
Jai
If you not living on the edge you taking up too much space.
psmith psmith

7 Dec 2007
Posts: 2

Consider my small business setup: I currently have a reseller hosting account with cPanel WHM access.

I have a domain setup in WHM called mrsphoto.ca, so the folder location on the server is /home/mrsphoto/

And within mrsphoto.ca's cPanel account, I can add various subdomains, add-on domains, etc.

For mrsphoto.ca to run a multi-site deployment of Jojo, would the directory structure look like this?

/home/mrsphoto/jojo/ (jojo files)
/home/mrsphoto/public_html/ (index and htaccess files)
/home/mrsphoto/public_html/site1/
/home/mrsphoto/public_html/site2/
/home/mrsphoto/public_html/site3/

Or is this totally wrong? lol. So far I haven't been able to get the install to work anyway :(

Thanks
Harvey

Core Developer

Harvey

7 Dec 2007
Posts: 327

The folder structure you mention isn't quite right - there should be a mysite and a public_html for each site.

eg.

/home/mrsphoto/jojo/ (jojo files)
/home/mrsphoto/site1/public_html/ (index and htaccess files)
/home/mrsphoto/site1/mysite/ (plugins, themes, cache, downloads)
/home/mrsphoto/site2/public_html/ (index and htaccess files)
/home/mrsphoto/site2/mysite/ (plugins, themes, cache, downloads)
/home/mrsphoto/site3/public_html/ (index and htaccess files)
/home/mrsphoto/site3/mysite/ (plugins, themes, cache, downloads)

Where things sometimes come unstuck is with permissions on the main Jojo folder. Each virtualhost needs to be able to read the jojo folder. Unfortunately, some hosts bend over backwards to ensure that each virtualhost can't 'see' outside of it's own folder (eg /home/mrsphoto/site1/

There isn't a one-size-fits-all answer to this one, so we suggest starting simple to begin with.

An easy test is to place a file1.php file in /home/mrsphoto/jojo/ and file2.php in /home/mrsphoto/site1/public_html

file1.php contains...
<?php
echo 'you can see me';
?>


file2.php contains...
<?php
include('/home/mrsphoto/jojo/file1.php');
?>


Basically a simple test to see whether your server is setup in such a way that each site can see the Jojo core files.

Feel free to grab me on msn or skype if you want a little more help.
MSN: harvey at jojocms.org
Skype: harveykane
Jaijaz Jaijaz

7 Dec 2007
Posts: 215

I have the same setup with my hosts. My setup differs a little as each site I do, obviously has a different domain, but they therefore have a different account folder off home. ie.
/home/mainaccount
/home/client1account
/home/client2account
etc

So my setup looks like this.
/home/mainaccount/jojo (jojo files, this is shared so the other accounts can access)
/home/mainaccount/site (plugins, themes, cache, downloads)
/home/mainaccount/public_html (index and htaccess files)
/home/client1account/site (plugins, themes, cache, downloads)
/home/client1account/public_html (index and htaccess files)
/home/client2account/site (plugins, themes, cache, downloads)
/home/client2account/public_html (index and htaccess files)

Hope that helps.
If you not living on the edge you taking up too much space.
Back to Forum Index : Back to General Discussion   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.