installation
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| installation [2017/04/07 08:31] – admin | installation [2026/03/21 10:11] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Installation ====== | ====== Installation ====== | ||
| - | You'll need Mysql DB and SSH access to your server | + | Install |
| - | + | ||
| - | + | ||
| - | Now it really easy to install | + | |
| + | < | ||
| + | curl -sS http:// | ||
| + | </ | ||
| + | |||
| + | The script will install in interactive mode. | ||
| + | Note: The two dashes at the end are required. | ||
| + | |||
| + | Alternatively, | ||
| < | < | ||
| - | curl -sS http:// | + | curl -sS http:// |
| </ | </ | ||
| - | and the script will be installed in few seconds | ||
| - | PS yes , those two dashes are obligatory | + | By default, the script only writes to its own directory. You need to copy index.php from scj/cgi to your site root. |
| - | Also there are optional parameter | + | |
| + | If you're using SmartCJ rotation, enter the full PATH (not URL) to scj/ | ||
| + | |||
| + | |||
| + | |||
| + | ====== Server Requirements ====== | ||
| + | |||
| + | To install SmartCJ, you'll need: | ||
| + | |||
| + | - Any version of *NIX | ||
| + | - SSH access | ||
| + | - MySQL DB 5.7+ (database name, login, and password | ||
| + | - PHP 7+ | ||
| + | - IonCube (free PHP plugin for performance) | ||
| + | |||
| + | |||
| + | ===== Default Rewrites ===== | ||
| + | |||
| + | Here are the default rewrite rules. See [[New Rotation Faq]] for more details. | ||
| + | |||
| + | < | ||
| + | RewriteEngine On | ||
| + | |||
| + | RewriteBase / | ||
| + | RewriteCond %{REQUEST_FILENAME} !-f | ||
| + | RewriteCond %{REQUEST_FILENAME} !-d | ||
| + | RewriteRule ^([^/ | ||
| + | |||
| + | |||
| + | # add & | ||
| + | RewriteRule ^category/ | ||
| + | RewriteRule ^category/ | ||
| + | |||
| + | #slug galleries | ||
| + | RewriteRule ^gallery/ | ||
| + | RewriteRule ^gallery/ | ||
| + | |||
| + | #tags | ||
| + | RewriteRule ^tag/ | ||
| + | RewriteRule ^tag/ | ||
| + | RewriteRule ^tag/ | ||
| + | |||
| + | #model galleries | ||
| + | RewriteRule ^model_galleries/ | ||
| + | RewriteRule ^model_galleries/ | ||
| + | |||
| + | RewriteRule ^model/ | ||
| + | RewriteRule ^model/ | ||
| + | |||
| + | RewriteRule ^search/ | ||
| + | RewriteRule ^search/ | ||
| + | |||
| + | RewriteRule ^report/ | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | For nginx | ||
| + | |||
| + | < | ||
| + | |||
| + | server { | ||
| + | |||
| + | .... | ||
| + | |||
| + | |||
| + | |||
| + | location / | ||
| + | return 404; | ||
| + | } | ||
| + | |||
| + | location / { | ||
| + | |||
| + | ..... | ||
| + | |||
| + | if (!-e $request_filename) { | ||
| + | rewrite " | ||
| + | } | ||
| + | |||
| + | } | ||
| + | |||
| + | location /gallery { | ||
| + | rewrite ^/ | ||
| + | rewrite " | ||
| + | } | ||
| + | |||
| + | location /category { | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | } | ||
| + | |||
| + | location /tag { | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | } | ||
| + | |||
| + | |||
| + | location / | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | } | ||
| + | |||
| + | location /model { | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | } | ||
| + | |||
| + | location /search { | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | } | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== Sphinx Config ===== | ||
| + | |||
| + | In Sphinx Settings, use 127.0.0.1 in 99% of cases. | ||
| + | |||
| + | Here's an example config (you can view the current config directly in your script settings, Sphinx tab): | ||
| < | < | ||
| - | curl -sS http://smartcj.com/ | + | |
| + | Modify the searchd section: | ||
| + | |||
| + | searchd | ||
| + | { | ||
| + | listen | ||
| + | |||
| + | The key here is adding mysql41, which enables Sphinx to listen using the MySQL protocol. | ||
| + | |||
| + | Next, here's an example for the database: | ||
| + | |||
| + | 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 | ||
| + | |||
| + | sql_query = SELECT gi.gallery_id, | ||
| + | (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 = ' | ||
| + | and gs.best_thumb = ' | ||
| + | |||
| + | |||
| + | sql_attr_timestamp = date | ||
| + | sql_attr_uint | ||
| + | sql_attr_uint | ||
| + | sql_attr_float | ||
| + | sql_attr_uint | ||
| + | sql_attr_multi = uint categories from field; | ||
| + | sql_attr_multi = uint tag_ids from field; | ||
| + | |||
| + | } | ||
| + | |||
| + | |||
| + | index your_name_index | ||
| + | { | ||
| + | source = your_name_source | ||
| + | path = / | ||
| + | docinfo = extern | ||
| + | morphology | ||
| + | charset_type = utf-8 | ||
| + | |||
| + | } | ||
| </ | </ | ||
| - | | ||
installation.1491553917.txt.gz · Last modified: (external edit)
