User Tools

Site Tools

Translations of this page:

Sidebar

Documentation index

new_rotation_multidomains

New Rotation Multidomains

Main purpose of this is to start multiply sites with different traders using the same thumbs DB. You can even run those sites on different servers. The process is easy: you create one site (master) and fill it with galleries\thumbs, after that you link other scj sites.

3 Easy steps:

  1. Create master site, add galleries and so on
  2. Install SmartCJ on another domain (you'll need separate DB for it, do not install into the same DB as master)
  3. at that new site: Rotation - Settings, select external DB, type you data and click “Link to This DB”

That's all.

Why you should use it:

  1. No need add the same galleries to both sites, you add a gallery at master site and get the same gallery at all slaves
  2. Common sponsors, no need to add sponsors at each site
  3. 10 domains using 1 DB is easier for server then 10 DBs
  4. You can grab galleries at one site, no need to setup crop profiles at each site
  5. You can create custom gallery at master site but have different designs for it at each slave
  6. there's no server limitation, you can have masters and 10 15 20 and so on slaves at one server and 10 20 30 at another server

Limitations:

  1. template names should be the same for all sites
  2. 1 slave can be linked to 1 master only, master site can has unlimited slaves

Common data:

  1. Thumbs, categories, sponsors - they can have different descriptions at each slave but the list is the same
  2. Tags and tags cloud

Separate data for each slave:

  1. Traffic stats, thumbs CTR
  2. thumbs\category\sponsor descriptions - you can have different descriptions for each slave

1 master and several niches You can create a one-niche site using multiniche master site

  1. setup new domain and smartcj
  2. link to master
  3. disable all unnecessary rotation groups at new slave

Thumb save method

  • at master site: rotation - settings : Thumb save method . If you save thumbs at local server (/scj/thumbs by default) result thumbs get relative url. For example script saves thumb id=123. It takes “URL to data ” = /scj/thumbs and adds 123.jpg so result is /scj/thumbs/123.jpg When you output thumb at master site absolute url = http://master/scj/thumbs/123.jpg and that's ok. But on slave site you'll get http://slave/scj/thumbs/123.jpg and error 404. That's why you have to type master's domain into Rotation - Settings - Alternative hosts
  • Make sure you allow hotlink from slave domains at master (ask admin if you dont know what is hotlink)

Slave at other servers

  • Master ans slave can be at different servers but
  • it's advisable to have it in the same datacenter
  • by default mysql refuses connections from other server then localhost. ask admin to fix it.

Send to Master Galleries

By default slave sites link to galleries at the same domain. Ie we created a custom gallery. Actually it's just a list of content (thumb, big images, movie files and so on). Each domain displays that content using it's own template.

so http://master/gallery/cool/index.html and http://slave/gallery/cool/index.html

will output he same content but using it's own template. And it's good and it is supposed to be this way.

But sometimes you want all slave to link to galleries at master only. First of all you'll try to change links from /gallery/GALLERY_SLUG/index.html?rotation_params to http://master/gallery/GALLERY_SLUG/index.html?rotation_params

It will work but it links straight to master site and slave site won't get rotation info.

There are 2 options

1. Change subtemplate so traffic will go thought slave's out.php

/gallery/GALLERY_SLUG/index.html?<!--THUMB_LINK--> 
to
/scj/cgi/out.php?url=http://master/gallery/GALLERY_SLUG/index.html&link=images/<!--THUMB_LINK-->

2. or change rewrite

RewriteRule ^gallery/([^/]+)/index.html$ /scj/cgi/out.php?link=images/%{QUERY_STRING}&url=content&slug=$1 [L]

to

RewriteRule ^gallery/([^/]+)/index.html$ /scj/cgi/out.php?link=images/%{QUERY_STRING}&url=http://master/gallery/$1/index.html [L]
new_rotation_multidomains.txt · Last modified: 2014/01/29 18:04 (external edit)