Install ownCloud 9.1.0 – CentOS 6.7 / 7.2

ownCloud is a great project which let’s you create your own self-hosted Dropbox / Google Drive alternative. It’s also great for organizations which want to manage assets rather than just holding them on drives with no way of finding data efficiently.

Installing ownCloud is pretty straight forward, you need a server with Apache, PHP 5.4+ and MySQL / MariaDB 5.5+

To install the prerequisites, first make sure you have the epel repo installed.

yum install epel-release

On to installing the dependencies,

yum groupinstall "Development Tools" 
yum install libxml2 php-ctype php-dom php-gd php-iconv php-json php-libxml php-devel
yum install php-mbstring php-posix php-simplexml php-xmlwriter php-zip 
yum install php-zlib php-mysqlnd php-curl php-fileinfo php-bz2 php-intl 
yum install php-mcrypt php-ldap php-ftp php-imap php-exif php-gmp php-memcache

Restart Apache to load the new modules

service httpd restart

Now it’s time to install a cache, you can choose between apc, apcu, memcached and redis. We’ve chosed memcached.

yum install memcached

Configure the memcache config file at /etc/sysconfig/memcached

PORT="11211"
USER="memcached"
MAXCONN="10240"
CACHESIZE="3072"
OPTIONS="-l 127.0.0.1"

Restart memcached

service memcached restart

Install the image processor, ImageMagick

yum install ImageMagick ImageMagick-devel

Add the imagick module to PHP

pecl install imagick

Now load the imagick ini to PHP, create a file at /etc/php.d/imagick.ini and add the following:

extension=imagick.so

Restart Apache so this ini is loaded

service httpd restart

Time now to install FFMPEG

Add the atrpms repo

rpm -ivh https://www.mirrorservice.org/sites/dl.atrpms.net/el7-x86_64/atrpms/stable/atrpms-repo-7-7.el7.x86_64.rpm

Edit the repo file located at /etc/yum.repos.d/atrpms.repo and change the baseurl to the following:

baseurl=https://www.mirrorservice.org/sites/dl.atrpms.net/el$releasever-$basearch/atrpms/stable
enabled=0

To install

yum --enablerepo=atrpms install ffmpeg

Now, on to downloading ownCloud. Navigate to the following URL and download the latest version of ownCloud

https://owncloud.org/install/#instructions-server

Move this file to /var/www/html/owncloud and unzip it there.

Note: The Apache home directory is assumed to be the default one in this case, you may want to setup a vhost for owncloud.

Create and set the correct owner and permission for the folder /var/www/html/owncloud/data and hit the directory in your browser.

http://IP/owncloud

A small setup will start asking you to create an admin account and set the DB credentials, at this point create a new DB with corresponding credentials and fill the fields accordingly.