Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Deployment Guide

Daniel Yazbek edited this page Sep 25, 2015 · 10 revisions

This guide assumes that the target system is running CentOS 6.5

Install OwnCloud

Install Owncloud 6.0.4 (Note that we assume '/var/www/html' is your webserver document root):

$ sudo su
$ cd ~
$ wget https://download.owncloud.org/community/owncloud-6.0.4.tar.bz2
$ tar xvjf owncloud-6.0.4.tar.bz2
$ sudo cp -r owncloud /var/www/html

Install Cr8it Dependencies

Cr8it has an ePub download feature which is dependent on Calibre. To install Calibre:

$ sudo yum install xz.x86_64
$ sudo -v && wget --no-check-certificate -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"

The install is supposedly self-contained, but you may get the following error:

RuntimeError: Failed to load ImageMagick: libltdl.so.7: cannot open shared object file: No such file or directory

In which case you will need to install libtool-ltdl:

$ sudo yum -y install libtool-ltdl

Install Cr8it

  1. Switch back to normal user (i.e. exit out of root user).
  2. If this is a brand new server you will need to create a ssh key ($ ssh-keygen -t rsa), and add it ($ cat ~/.ssh/id_rsa.pub) to the deploy keys on the settings page (https://github.com/IntersectAustralia/owncloud/settings/keys) of the project's github repo. See https://help.github.com/articles/generating-ssh-keys/ for more details
  3. Install git and clone the repository.
$ sudo yum -y install git
$ git clone git@github.com:IntersectAustralia/owncloud.git
$ cd owncloud
$ git submodule init
$ git submodule update
  1. Change the user folder ("/home/username") permissions so that the apache user can resolve the symlinks
$ sudo su
$ cd /home
$ chmod a+x <username>/
  1. Make sure you are still logged in as root user. Go to owncloud apps subdirectory and link the appropriate folders.
$ cd /var/www/html/owncloud/apps/
$ ln -s /home/<username>/owncloud/apps/crate_it
$ ln -s /home/<username>/owncloud/apps/file_previewer
$ chown -R apache:apache /home/<username>/owncloud/apps/crate_it
$ chown -R apache:apache /home/<username>/owncloud/apps/file_previewer
  1. Make sure you are still logged in as root user. Set the correct permission for all owncloud directories.
$ chown -R apache:apache /var/www/html/owncloud
$ find /var/www/html/owncloud -type d -exec chmod 750 {} \;
$ find /var/www/html/owncloud -type f -exec chmod 640 {} \;

Install Apache and PHP

You will need to install Apache and PHP if these have not already been installed:

$ sudo yum install httpd php php-dom php-mbstring php-gd php-pdo mod_xsendfile

Configure Apache

Now test that you can follow the links as the apache user by trying to cd into the linked folders. Log in as root (sudo su) then edit the OwnCloud Apache config file in /etc/httpd/conf.d/owncloud.conf and add the Options FollowSymLinks line so it looks like the following:

owncloud.conf

<Directory /var/www/html/owncloud>
Options FollowSymLinks
AllowOverride All
XSendFile On
XSendFilePath /tmp/cr8it/crates
</Directory>

Start up Apache and make sure it starts on boot

$ sudo su
$ service httpd start
$ chkconfig httpd on

Set Up Admin Account

Set up an admin account on OwnCloud by visiting:

http://<HOSTNAME>.intersect.org.au/owncloud/

Enter a username and password. Now you should be able to log into Owncloud with the credentials you entered.

Configure Owncloud and Cr8it

Enable App Framework Plugin

The App Framework plugin is required for cr8it to work properly. To enable the framework, click on the '+ Apps' icon, locate 'App Framework for Owncloud', then click 'Enable'.

Enable Cr8it Plugin

The cr8it plugin might not be enabled by default. To do so, click on the '+ Apps' icon, locate 'Cr8it', then click 'Enable'.

Edit Cr8it Config File

Edit the file '/var/www/html/owncloud/data/cr8it_config.json' with the correct settings. To make sure you have the correct format, simply copy the sample cr8it config file into '/var/www/html/owncloud/data/cr8it_config.json', then replace the place-fillers (text in "<>") accordingly. In particular, please update these entries:

  • "mint" - Change the url to your mint server url. This is where Cr8it get the Creators and Grants lookup information.
  • "publish endpoints" - Change the test sword server (if any) and real sword server (where you'd like to publish to) settings, make sure you have the correct credentials.

The rest of the settings should remain untouched.

Once you have completed the cr8it_config.json file, restart the server:

$ sudo su
$ service httpd restart

NOTE

If you go to the Crate It page and you cannot see any folders/files, or the metadata section on the right hand side, that the cr8it config file is not set up properly. Edit the file again, then restart the server.

Smoke Tests

You should now have completed the Cr8it Installation Process. Please run the following smoke tests to ensure the new deployment was successful. Smoke Tests

Updating Cr8it

Cr8it is an ordinary git repository, so you can just ssh into the server as the devel user, and do a git pull. If you want to switch to a specific tag, you can git checkout .

Performance Tweaks

Owncloud and Cr8it can begin to run progressively more slowly. This page documents a few workarounds that may improve performance.

Disable Apps

In the apps configuration page ('+ Apps' button on the bottom left), disable all apps other than Cr8it.

Cron Settings

Go into admin settings and change the 'Cron' section to Cron. The default setting is AJAX which means all background tasks are run on every page load!

Manually Clear Cruft

  1. Log in to the server where Owncloud is running
  2. Change to root user ('sudo root')
  3. Go to the owncloud data directory (.e.g /var/www/html/owncloud/data)

Each user has their own subdirectory here. Within each user's subdirectory there are two other subdirectories that contain artifacts from two owncloud apps in particular that appear to slow down the system ('versions' and 'full text search'). The easiest way to clear these out is to delete the contents of the files_trashbin/ and lucene_index/ directories.