User Tools

Site Tools


Translations of this page:
ru:installation

Installation

Устанавливается скрипт одной строкой в шеле. Перейдите в домен где вы хотите установить скрипт и выполните команду

curl -sS http://smartcj.com/updates2/install | php -- 

и скрипт будет установлен в интерактивном режиме. PS да, два тире в конце обязательны

так же можно указать все параметры прямо в коммандной строке

curl -sS http://smartcj.com/updates2/install | php -- mysql_host= mysql_user= mysql_pass= mysql_name= scj_folder= domain= admin_email=

Обратите внимание, что по дефолту скрипт что-то пишет только в совй каталог, поэтому надо скопировать index.php из scj/cgi на корень вашего сайта.

Server Requirements

Для установки SmartCJ необходимо:

  1. Любая версия *NIX
  2. SSH доступ
  3. Mysql DB (название, логин и пароль значения не имеют)
  4. IonCube (бесплатный плагин для ПХП для ускорения работы)

Default Rewrites

Это дефолтные реврайты New Rotation Faq

 
RewriteEngine On

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]{2})/(.*)$ $2?force_lng=$1&%{QUERY_STRING} [L]


# add &dont_count_in_trade=true if you dont want to count these clicks
RewriteRule ^category/([^/]+)/$ /script_folder_name/cgi/out.php?url=content&p=100&skip_sell=true&group_name=$1&order=ctr&%{QUERY_STRING} [L]
RewriteRule ^category/([^/]+)/([^/]+)/([^/]+)/$ /script_folder_name/cgi/out.php?url=content&p=100&skip_sell=true&group_name=$1&order=$2&page=$3&%{QUERY_STRING} [L]

#slug galleries
RewriteRule ^gallery/([^/]+)/index.html$ /script_folder_name/cgi/out.php?url=content&slug=$1&%{QUERY_STRING} [L]
RewriteRule ^gallery/([^/]+)/([0-9]{1,2}).html$ /script_folder_name/cgi/out.php?url=content&slug=$1&item_id=$2&%{QUERY_STRING} [L]

#tags
RewriteRule ^tag/([^/]+)/([^/]+)/([^/]+)/$ /script_folder_name/tube/index.php?tag=$1&page=$3&order=$2&%{QUERY_STRING} [L]
RewriteRule ^tag/([^/]+)/([^/]+)/$ /script_folder_name/tube/index.php?tag=$1&page=$2&%{QUERY_STRING} [L]
RewriteRule ^tag/([^/]+)/$ /script_folder_name/tube/index.php?tag=$1&%{QUERY_STRING} [L]

#model galleries
RewriteRule ^model_galleries/([^/]+)/$ /script_folder_name/tube/?model_slug=$1&force_template=model_galleries [L]
RewriteRule ^model_galleries/([^/]+)/([^/]+)/$ /script_folder_name/tube/?model_slug=$1&page=$2&force_template=model_galleries [L]

RewriteRule ^model/([^/]+)/$ /script_folder_name/tube/?model_slug=$1&force_template=model_galleries&%{QUERY_STRING} [L]
RewriteRule ^model/([^/]+)/([^/]+)/([^/]+)/$ /script_folder_name/tube/?model_slug=$1&force_template=model_galleries&order=$2&page=$3&%{QUERY_STRING} [L]

RewriteRule ^search/([^/]+)/([^/]+)/$ /script_folder_name/tube/index.php?search=$1&page=$2&%{QUERY_STRING}
RewriteRule ^search/([^/]+)/([^/]+)/([^/]+)/$ /script_folder_name/tube/index.php?search=$1&order=$2&page=$3&%{QUERY_STRING}

RewriteRule ^report/([^/]+)/$ /script_folder_name/tube/index.php?gallery_id=$1&force_template=content_report&%{QUERY_STRING}

Для nginx

 

server {
        
        ....
        
        
        
	location /script_folder_name/scj2.lic {
	    return 404;
	}

	location / {

                .....

		if (!-e $request_filename) { 
		    rewrite "^/([^/]{2})/(.*)$" /$2?force_lng=$1&$query_string ; 
		} 

	}

	location /gallery {
	    rewrite ^/gallery/([^/]+)/index.html$ /script_folder_name/cgi/out.php?url=content&slug=$1&$query_string ;
	    rewrite "^/gallery/([^/]+)/([0-9]{1,2}).html$" /script_folder_name/cgi/out.php?url=content&slug=$1&item_id=$2&$query_string ;
	}

	location /category { 
	    rewrite ^/category/([^/]+)/$ /script_folder_name/cgi/out.php?url=content&p=100&dont_count_in_trade=true&skip_sell=true&group_name=$1&order=ctr&$query_string ; 
	    rewrite ^/category/([^/]+)/([^/]+)/([^/]+)/$ /script_folder_name/cgi/out.php?url=content&p=100&dont_count_in_trade=true&skip_sell=true&group_name=$1&order=$2&page=$3&$query_string ; 
	} 

	location /tag { 
		rewrite ^/tag/([^/]+)/([^/]+)/([^/]+)/$ /script_folder_name/tube/index.php?tag=$1&page=$3&order=$2&$query_string ; 
		rewrite ^/tag/([^/]+)/([^/]+)/$ /script_folder_name/tube/index.php?tag=$1&page=$2&$query_string ; 
		rewrite ^/tag/([^/]+)/$ /script_folder_name/tube/index.php?tag=$1&$query_string ; 
	}


	location /model_galleries { 
		rewrite ^/model_galleries/([^/]+)/$ /script_folder_name/tube/?model_slug=$1&force_template=model_galleries ; 
		rewrite ^/model_galleries/([^/]+)/([^/]+)/$ /script_folder_name/tube/?model_slug=$1&page=$2&force_template=model_galleries ; 
	} 
	
	location /model { 
		rewrite ^/model/([^/]+)/$ /script_folder_name/tube/?model_slug=$1&force_template=model_galleries&$query_string ; 
		rewrite ^/model/([^/]+)/([^/]+)/([^/]+)/$ /script_folder_name/tube/?model_slug=$1&force_template=model_galleries&order=$2&page=$3&$query_string ; 
	} 
	
	location /search { 
		rewrite ^/search/([^/]+)/([^/]+)/$ /script_folder_name/tube/index.php?search=$1&page=$2&$query_string; 
		rewrite ^/search/([^/]+)/([^/]+)/([^/]+)/$ /script_folder_name/tube/index.php?search=$1&order=$2&page=$3&$query_string; 
	}

Sphinx Config

Обратите внимание, что в Sphinx Settings в 99% случае надо писать 127.0.0.1

Пример конфига (актуальный конфиг можно увидеть прямо в сеттингах вашего скрипт, таб sphinx )

Надо внести изменения в секцию 

searchd
{
	listen      			= your_port:mysql41

основное тут - добавление mysql41, новый вариант для сфинкс слушать по протоколу mysql 

Далее пример для базы

source your_name_source
{
	type					= mysql

	sql_host				= localhost
	sql_user				= 
	sql_pass				=
	sql_db					= 
	sql_port				= 3306	# optional, default is 3306

	sql_query_pre = SET NAMES utf8

	sql_query				= SELECT gi.gallery_id, UNIX_TIMESTAMP(gi.activation_date) as date, alt, description, gi.duration, sponsor_id, gs.total_ctr, gi.content_type, \
							(SELECT group_concat(tag_name) FROM rot_gal2tag g2t \
							LEFT JOIN rot_tags as t on t.tag_id = g2t.tag_id \
							WHERE g2t.gallery_id = gi.gallery_id) as tags, \
							(SELECT group_concat(tag_id) FROM rot_gal2tag g2t \
							WHERE g2t.gallery_id = gi.gallery_id) as tag_ids, \
							(SELECT group_concat(name) FROM rot_groups  \
							WHERE rot_groups.id in (SELECT group_id FROM rot_gallery_stats1 WHERE rot_gallery_stats1.gallery_id = gi.gallery_id AND group_id != 0) ) as group_names, \
					                                                                 \
							(SELECT group_concat(name) FROM rot_groups  \
							WHERE rot_groups.id in (SELECT group_id FROM rot_gallery_stats1 WHERE rot_gallery_stats1.gallery_id = gi.gallery_id AND group_id != 0) ) as group_names, \

							(SELECT group_concat(gss.group_id) FROM rot_gallery_stats1 as gss \
							WHERE gss.gallery_id = gi.gallery_id AND group_id != 0) as categories \
							FROM rot_gallery_info AS gi \
							JOIN rot_gallery_data1 AS gd ON gi.gallery_id = gd.gallery_id \
							JOIN rot_gallery_stats1 AS gs ON gs.gallery_id = gi.gallery_id \
							WHERE gallery_status = 'active' and gallery_type = 0 \
							and gs.best_thumb = 'yes' and gs.group_id = 0 AND gs.group_id NOT IN (SELECT group_id FROM rot_groups_data WHERE status != 1)


	sql_attr_timestamp		= date
	sql_attr_uint		    = duration
	sql_attr_uint		    = sponsor_id
	sql_attr_float		    = total_ctr
	sql_attr_uint		    = content_type
    sql_attr_multi 			= uint categories from field; 
    sql_attr_multi 			= uint tag_ids from field; 

}


index your_name_index
{
	source					= your_name_source
	path					= /your_path
	docinfo					= extern
	morphology              = stem_en
	charset_type 			= utf-8

}
ru/installation.txt · Last modified: 2019/10/30 08:49 by admin