Installing Owncloud

Own cloud the enterprise version of Dropbox, this on the face of it an amazing product, but as with all open source suffers a little in the documentation front. I must say though the installation guide is pretty good and gets you 99% of the way there. As always there are some little work a rounds, but with out these life would be boring.

Anyway on with installation as usual I have followed the install instructions and just added bits where needed. The owncloud install instructions can be found at

The install is being done on a minimal install CentOS 6.4 image from the AWS market place, I like these images and they come straight from CentOS and they are not bloated. The other thing to note is that this installation is tailored to an AWS and S3 back end install. There are a number of packages therefore not install e.g. SMB etc…

Because of the light installation there are a few bits required

yum install -y wget httpd php php-mysqli php-pear php-gd  php-xml php-intl php-mysql php-curl curl libcurl

There is an issue when you install Own cloud with some missing dependencies

You will get the following error


Installing Own Cloud



mkdir /opt/software
cd /opt/software
rpm -Uvh epel-release-6-8.noarch.rpm
yum install -y php-pear-Net-Curl php-pear-MDB2-Driver-mysqli

Once the dependencies are done lets install Own Cloud, this is taken from the installation document.

cd /etc/yum.repos.d/


yum install owncloud
vi /etc/http/conf/ownload.conf
<IfModule mod_alias.c>
 Alias /owncloud /var/www/owncloud/
 <Directory /var/www/owncloud/>
 Options None
 Order allow,deny
 allow from all
 <VirtualHost *:80>
 DocumentRoot /var/www/html/owncloud
 ErrorLog logs/
 CustomLog logs/ common


echo Include /etc/httpd/conf/owncloud.conf >> /etc/httpd/conf/httpd.conf
service httpd start

Now it time to get the MySQL database ready,

Log on to the MySQL database, you will need mysql installed if you are doing this from the Own Cloud server

yum install -y mysql
mysql -u USERNAME -p -h MysSQL_Host_Name
create database owncloud;
create user 'owncloud'@'localhost' identified by 'password';
create user 'owncloud'@'%' identified by 'password';
grant all on owncloud.* to 'owncloud_live'@'localhost' with grant option;
grant all on owncloud.* to 'owncloud_live'@'%' with grant option;

OK one last thing before we start, this instance of CentOS has the firewall enabled, for ease of debugging we shall just turn the firewall off an revisit the security to the site afterwards, one of the beauties of AWS is the access control that you can set to the server at instance level so you could if you wanted to turn the firewall off completely.

service httpd stop

OK now to start the Own Cloud web installation, again from the installation instructions


The first thing that you maybe prompted with is

Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)

Please update your PHP installation to use ownCloud securely.

Not sure how to fix this yet

Enter new credentials for the admin user, click on advanced so that you can enter the mysql details.

You will be prompted with this error

MySQL username and/or password not valid

You need to enter either an existing account or the administrator.

Obviously the first thing to check is that you typed the name and password in correctly, but the chances are that you have, the error occurs because selinux is enable, again we will disable this for the installation.

To just disable selinux for now

echo 0 >/selinux/enforce

If you want to do this permanently then

vi /etc/selinux.conf and change the enfoced line to disabled

No for the storage configuration, enabling s3 in owncloud

Create a s3 bucket to store all of the assets in

AWS console and create the bucket, I am not go into the details of how to do this, Google is your friend, and if you can create a directory in windows explorer you can create a bucket. In this example the bucket is called


Now create a special IAM AWS user that only has access to the Own Cloud files

IAM create user owncloud with a secret instead of a password. Add a group security policy as follows. I will give you this code as Google is your friend, but there is a slight peculiarity to creation and access.


Attach a policy that looks something like this


 “Version”: “2012-10-17”,

 “Statement”: [


     “Action”: [



     “Sid”: “Stmt1373389401000”,

     “Resource”: [



     “Effect”: “Allow”



     “Action”: [



     “Sid”: “Stmt1373389436000”,

     “Resource”: [




     “Effect”: “Allow”





Note the list all buckets is required so that the user can read s3, there is a post explaining this s3fs refuses to mount s3 bucket when restricted IAM used

To test that you have access to the buckets etc.. install s3cmd, instructions Installing S3CMD on Amazon Server

OK now this was a little confusing to start with because the forums and the documentation talks about editing the config.php file and inserting the following.  Searching for S3 bucket does not show in Own Cloud did not bring back any results. The information that the installation documents say to add is as follows :-

array( ‘class’=>’OC_Filestorage_AmazonS3’,

This appears how it used to be done, not too sure ?

The new version has a lot better interface, you first need to allow the 3rd Party app for external storage to be active.

As and admin of Own Cloud log in and chose

admin –> apps –> external storage support

Enable this. when you the chose admin –> setting you will get an external storage support panel where you can choose S3 as storage and enter the relevant details.

You should now have and Owncloud server up and running, stop back soon to see how you configure it and get more out of it.

, ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Open Source Made Easy

Unanswered Questions Answered

Helping you achieve more

The Survival Guides's Blog

How to Survive IT and Holidays is the best place for your personal blog or business site.

%d bloggers like this: