Setup cloud storage service like dropbox with owncloud

owncloud_logoOwnCloud provides a platform to easily view & sync your contacts, calendars and bookmarks across all your devices and enables basic editing right on the web. This tutorial guides how to setup a cloud storage service like dropbox with owncloud on CentOS 6.x. This guide also help to do selective sync with owncloud clients. More information about this software can be found at their website.

I. Setting up OwnCloud

  1. Install necessary repos:[bash]cd /etc/yum.repos.d/
    wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo
    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm[/bash]
  2. Install OwnCloud with yum:[bash]yum install owncloud[/bash]
  3. Start httpd service and enable it when the server starts:[bash]service httpd start
    chkconfig httpd on[/bash]
  4. Change the max post filesize and max upload filesize at /var/www/html/owncloud/.htaccess
  5. Setting up crontab to be run in background instead of running every request:[bash]crontab -e
    */15 * * * * php -f /var/www/html/owncloud/cron.php[/bash]

    . Then, access Admin >> Cron and select “Use systems cron service to call the cron.php file every 15 minutes.”

II. Enable secure connection

  1. Install mod_ssl:[bash]yum install mod_ssl[/bash]
  2. Copy private ket, certificate file, key chain intermediate files to /etc/pki/tls/
  3. Enable ssh vhost by adding the following lines to /etc/httpd/conf.d/owncloud.conf:[bash]NameVirtualHost *:443
    <VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/your-certificate-file.crt
    SSLCertificateKeyFile /etc/pki/tls/your-private-key-file.key
    SSLCertificateChainFile /etc/pki/tls/your-keychain-ca-intermediate-file.crt
    <Directory /var/www/html/owncloud/>
    AllowOverride All
    </Directory>
    DocumentRoot /var/www/html/owncloud/
    ServerName your-server-name.com
    </VirtualHost>
    [/bash]
  4. Restart httpd to enable https connection:[bash]service httpd restart[/bash]
  5. Login to OwnCloud with Administrator account, go to Admin page, select “Enforce HTTPS” under the “Security” section.

All done! We now can start setup client software for backing up our files in any OSes (Windows, Mac, Linux, smartphones’ OSes)

Selective Sync with OwnCloud client software

By default, when an account is synchronized via client software, all folders/files in the account will be synced to your PC. The problem might be that you have a centralized account to sync from many PCs/servers and you do not want to download all these materials to your PC (due to smaller disk space compared to the cloud hard-disk size). The following trick will help we configure the client software to sync only necessary folders.

  1. Open “Settings…” in OwnCloud client.
  2. In “Account”, remove the default folder which synced all files in your account with the local folder.
  3. Add a new synced folder with “Add Folder…” button. By repeating this, you can add only folders you want to sync with current machine.

Leave a Reply