ownCloud Install - bapowell/bapowell.github.io GitHub Wiki

Installing ownCloud on OpenShift

Notes

  • The instructions below are for manually installing the latest version of ownCloud. If not interested in the latest version (or if the QuickStart has been updated to the latest), then follow the QuickStart instructions for a simpler install.

References

Install

Create app on OpenShift (creates local app git repository)

Note: phpmyadmin isn't required, but useful

rhc create-app owncloud php-5.4 mysql-5.5 cron phpmyadmin
rhc show-app owncloud
cd owncloud
rm index.php

Download latest ownCloud and install to local app repository

Note: using 6.0.2 for these instructions

cd ..   # back out of the owncloud app directory
mkdir owncloud-6.0.2-src
cd owncloud-6.0.2-src
wget http://download.owncloud.org/community/owncloud-6.0.2.tar.bz2
tar xjvf owncloud-6.0.2.tar.bz2
cd owncloud   # now in owncloud-6.0.2-src/owncloud directory
rsync -av . ../../owncloud/
cd ../..
# optional clean-up:  rm -rf  owncloud-6.0.2.tar.bz2  owncloud-6.0.2/
cd owncloud

Add OpenShift-specific files

Note: Obtain these files from one of the repositories listed above under References

autoconfig.php

owncloud/[php]/config/autoconfig.php

OpenShift action hooks

Note: Make these action hook files executable

Note: For OpenShift PHP 5.4, php directory doesn't exist, so had to modify pre_build and post_deploy files to remove it from paths

owncloud/.openshift/action_hooks/pre_build

  • Restores an existing configuration file (located in the $OPENSHIFT_DATA_DIR directory) and removes the autoconfig.php script above for succeeding pushes.

owncloud/.openshift/action_hooks/deploy

  • Ensures that the MySQL cartridge is available.

owncloud/.openshift/action_hooks/post_deploy

  • During the first push, it will auto-configure (using autoconfig.php) the ownCloud instance. For succeeding deployments, it will ensure that an existing configuration is used (creates a symbolic link from $OPENSHIFT_REPO_DIR/[php]/config/config.php to $OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME-config.php)

Cron

Some ownCloud apps such as News require background jobs to run regularly (this was the reason OpenShift's cron-1.4 cartridge was included above when creating the app)

Note: Make cron script file executable

Note: For OpenShift PHP 5.4, php directory doesn't exist, so had to modify owncloud.sh to remove it from paths

To run every 15 minutes add the following job script:

owncloud/.openshift/cron/minutely/owncloud.sh

Make sure to enable the system cron in ownCloud's Admin settings page

Commit and deploy to OpenShift

Note: Make sure git user.name and user.email have been set appropriately.

(assume currently in the owncloud app directory)
git add .
git commit -a -m "Initial deploy of ownCloud v6.0.2 to OpenShift"
git push

Log in and start using ownCloud on OpenShift

Note about trusted_domains setting (introduced with ownCloud 6.0.x)

Other considerations

Force SSL so all access is via https URL (strongly encouraged)

This can be changed in one of two ways:

  1. Add 'forcessl' => true,' to the ownCloud config file: $OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME-config.php
  2. Using https (https://owncloud-$yourdomain.rhcloud.com), log in to your ownCloud instance and in the Admin menu (admin -> Admin) check the "Enforce HTTPS" box under the Security heading. Note that this adds the 'forcessl' entry to the config file.

Add alias to give your ownCloud site its own web address

rhc alias add owncloud your.alias.goes.here

Note that you'll also need to change your domain's DNS configuration (e.g. add a CNAME entry to point to https://owncloud-$yourdomain.rhcloud.com)