User Tools

Site Tools


new_rotation_multidomains

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

new_rotation_multidomains [2014/01/29 18:04]
new_rotation_multidomains [2014/01/29 18:04] (current)
Line 1: Line 1:
 +====== 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:
 +
 +  - Create master site, add galleries and so on
 +  - Install SmartCJ on another domain (you'll need separate DB for it, do not install into the same DB as master)
 +  - 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:**
 +  - No need add the same galleries to both sites, you add a gallery at master site and get the same gallery at all slaves
 +  - Common sponsors, no need to add sponsors at each site
 +  - 10 domains using 1 DB is easier for server then 10 DBs
 +  - You can grab galleries at one site, no need to setup crop profiles at each site
 +  - You can create custom gallery at master site but have different designs for it at each slave
 +  - 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:**
 +  - template names should be the same for all sites
 +  - 1 slave can be linked to 1 master only, master site can has unlimited slaves
 +
 +**Common data:**
 +  - Thumbs, categories, sponsors - they can have different descriptions at each slave but the list is the same
 +  - Tags and tags cloud
 +
 +
 +**Separate data for each slave:**
 +  - Traffic stats, thumbs CTR
 +  - 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
 +  - setup new domain and smartcj
 +  - link to master
 +  - 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
 +
 +<code>
 +/gallery/GALLERY_SLUG/index.html?<!--THUMB_LINK--> 
 +to
 +/scj/cgi/out.php?url=http://master/gallery/GALLERY_SLUG/index.html&link=images/<!--THUMB_LINK-->
 +</code>
 +
 +2. or change rewrite
 +<code>
 +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]
 +
 +</code>
new_rotation_multidomains.txt ยท Last modified: 2014/01/29 18:04 (external edit)