User Tools

Site Tools


wiki:qclug_presentations:cloud_hosting_aws_heroku_openshift

This is an old revision of the document!


OpenShift Demonstration Steps

How to create a Dokuwiki site on OpenShift Online

  • Create a free account at openshift.com
  • Install the OpenShift Client Tools (which is a Ruby Gem):

Step 1: Install Ruby
Step 2: Install RubyGems
Step 3: Install Git
Step 4: Install the client tools

(ruby-full installs the gem binary automatically)

sudo apt-get install ruby-full git-core
sudo gem install rhc

Setup RHC

rhc setup

Step 1: Login to openshift.redhat.com
Step 2: Generate a Public/Private key pair
Step 3: Create your namespace (aka domain)

Install DokuWiki

For ease of deployment use the pre-built dokuwiki-quickstart repository

  • This respository includes most of the deploy scripts that you will need to deploy Dokuwiki into OpenShift so you might as well use it.

https://github.com/openshift/dokuwiki-quickstart

Step 1: Create an empty application
Step 2: Download dokuwiki
Step 3: Push to OpenShift Online

rhc app create dokuwiki php-5.4
cd dokuwiki
git remote add upstream -m master git://github.com/openshift/dokuwiki-quickstart.git
git pull -s recursive -X theirs upstream master

Note: The git pull command above can be used later to pull updates to Dokuwiki

Customize DokuWiki

To customize Dokuwiki you must modify the git repository and the deploy scripts. This way your application customization will remain persistent accross each deployment.

Step 1: Install and configure custom Plugins
Step 2: Modify the Dokuwiki config files
Step 3: Update build and deploy hook scripts
Step 4: Commit locally
Step 5: Push to OpenShift
Step 6: Upload persistent data

Plugins

cd ~/dokuwiki/.openshift
mkdir plugins
cd plugins
wget https://github.com/kettari/authgoogle/archive/master.tar.gz
tar xf master.tar.gz
rm master.tar.gz
mv authgoogle-master authgoogle

Config Files

cd ~/dokuwiki/.openshift/conf
vi local.php
vi acl.auth.php
vi users.auth.php
cd ~/dokuwiki/.openshift
vi .htaccess

Hook scripts

cd ~/dokuwiki/.openshift/action_hooks
vi build
vi deploy
cd ~/dokuwiki
git add .
git commit
git push

Persistent Data

cd ~/dokuwiki-2014-05-05a/data/
tar czf ~/data-3-11-2015.tar.gz ./*
cd
rhc scp dokuwiki upload data-3-11-2015.tar.gz app-root/data/data/

Note: If rhc scp doesn't work, re-install the net-ssh gem specifying version 2.9.2

gem uninstall net-ssh
gem install net-ssh -v 2.9.2
rhc ssh dokuwiki
cd app-root/data/data
tar xf data-3-11-2015.tar.gz
rm data-3-11-2015.tar.gz

Add a custom domain (alias)

To use a custom domain name with OpenShift, simply add a CNAME alias to your externally hosted DNS configuration, and run the following command:

rhc alias add dokuwiki wiki.qclug.com

Misc Notes

You can obtain Secure Shell access to your application (Gear) by running the following command:

rhc ssh dokuwiki

The persistent date storage location for your application can be accessed in your deploy scripts by using the following environment variable:

$OPENSHIFT_DATA_DIRs
  • OpenShift Origin is the upstream Open Source project for OpenShift.
  • This means you can download it and host your own OpenShift cloud!

http://www.openshift.org/

wiki/qclug_presentations/cloud_hosting_aws_heroku_openshift.1426054386.txt.gz · Last modified: 2015/03/11 06:13 by Root