• 5 years

    4 years

    YetiShare / Core


Setup New Server with Nginx/PHP/MySQL, Install YetiShare, Migrate Data (CentOS 6)

This document details the notes we use for installing a YetiShare on a new 64 bit CentOS 6 server. Feel free to use it for configuring your own servers in preparation of installing YetiShare.

Setup Nginx, PHP, MySQL etc:

Use the following guide to get the core applications configured.

Upgrade PHP using Remi -

Install PHP Modules & Other Useful Apps:

# yum install mlocate php-gd php-curl php-mcrypt unzip zip php-cli curl php-soap php-mbstring php-xml
# updatedb
Restart Nginx and PHP:

# service nginx restart
# service php-fpm restart

MySQL Create Database & User:

Replace '[REPLACE_WITH_PASSWORD]' with a new random database password. Recommended to be at least 12 characters in length.

Login to MySQL as root.

# mysql -uroot -p
Input your root password you set earlier.

> create database yetidata;
> grant usage on *.* to [email protected] identified by '[REPLACE_WITH_PASSWORD]';
> grant all privileges on yetidata.* to [email protected];
> exit;

Install YetiShare:

You should now be set to install YetiShare. Upload the latest zip release code into your webroot (normally /usr/share/nginx/html/) using WinSCP or similar. Unzip via SSH like this: (replace with the zip filename)

# unzip

# unlink
Point your web browser to the script installer and follow the instruction onscreen.
Nginx rewrite rules for YetiShare will also need set. These can be found in the file called '___NGINX_RULES.txt' in the root of the zip download. Apply these to the Nginx config file:

# nano /etc/nginx/conf.d/default.conf
Restart Nginx after the changes:

# service nginx restart
Copy your main site files to a file server using rsync. Useful during upgrades, update your main site code and with any new plugins then run this to push the changes over to each file server. Replace the and server paths. Run it via SSH on your main server.

# rsync -avh --exclude 'files/*' --exclude 'core/logs/*' --exclude 'core/cache/*' --exclude '___OLD_SITE/*' --exclude '' /home/www/ [email protected]:/home/www

Important Information to Note:

Restart MySQL: service mysqld restart
Restart Nginx: service nginx restart
Restart PHP: service php-fpm restart
PHP Config: /etc/php.ini
MySQL Config: /etc/my.cnf
Nginx Main Site Config: /etc/nginx/conf.d/default.conf


After you've installed YetiShare you can tweak the server settings for better performance. See our other knowledge base article here:

Note: After any server config changes ensure you restart Nginx, MySQL & PHP (commands above).

Useful Commands:

Dump Database Tables to File Example:

# mysqldump -udatabase_user -p database_name > /root/db.sql
Send SQL File to Remote Server:

# rsync -avh /root/db.sql [email protected]:/root/db.sql
Import SQL File:

# mysql -udatabase_user -p database_name < /root/db.sql

Rsync Files:

# rsync -avh /usr/share/nginx/html/ [email protected]:/usr/share/nginx/html
(custom port: rsync -avh --rsh='ssh -p21088' /usr/share/nginx/html/ [email protected]:/usr/share/nginx/html/)

Set File/Folder Permissions:

# chmod -R 755 /usr/share/nginx/html/files/

If CHMOD 777 isn't working, disable selinux:

echo 0 > /selinux/enforce

Useful Resources: