Install ownCloud on a PHP Simple Hosting instance

Introduction

ownCloud is a suite of client-server software for creating file hosting services and using them. ownCloud is functionally very similar to the widely used Dropbox, with the primary functional difference being that ownCloud is free and open-source, and thereby allowing anyone to install and operate it without charge on a private server, with no limits on storage space (except for disk capacity or account quota) or the number of connected clients.

Source: https://en.wikipedia.org/wiki/OwnCloud

It is highly recommended to use HTTPS for owncloud, so that your data is not transmitted in plain-text.

Step 1 - Create the instance

First, we will create the instance using the Gandi CLI : http://cli.gandi.net

$ gandi paas create --name Owncloud --type phpmysql
password: 
Repeat for confirmation: 
Creating your PaaS instance.

Step 2 - Prepare database and associated user

We will now connect to the console of the instance to create a database named “owncloud-db”, and a user named 'owncloud-user' with password “owncloud-pass”. We'll also assign the user with proper rights to the database :

$ gandi paas console Owncloud

hosting-user@Owncloud:~$ mysql -u root

mysql> CREATE DATABASE owncloud-db;
Query OK, 1 row affected (0.01 sec)

mysql> CREATE USER owncloud-user;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL ON owncloud-db.* to 'owncloud-user'@'localhost' identified by 'owncloud-pass';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

Step 3 - Install ownCloud

Navigate to the root directory and download the setup script :

$ cd ~/web/vhosts/www.example.com/htdocs/
$ wget https://download.owncloud.com/download/community/setup-owncloud.php

Then navigate to the script URL: http://www.example.com/setup-owncloud.php

  1. Click 'Next' on the Startup Wizard page
  2. Enter the directory you wish to have ownCloud installed (Enter a single ”.” to install in the root of the htdocs directory)
  3. Click Next and wait while ownCloud is downloaded and extracted
  4. Click Next
  5. Enter an admin username and password
  6. Click on 'Storage & database', and select MySQL/MariaDB
  7. Input the database name and database user / password
  8. Click 'Finish Setup'

Step 4 - ownCloud tuning for APC

Here we will optimize the use of the APC cache with ownCloud. We will edit the file located at config\config.php, and add the memcache.local line shown below:

$ nano config/config.php
  'installed' => true, 
  'memcache.local' => '\OC\Memcache\APC',      
);
Last modified: 07/21/2015 at 20:56 by Richard M. (Gandi)