Skip to content

OwnCloud 9 and Centos 7

OwnCloud is one of the best things that happened in the Linux world. It provides a relatively pain free implementation of a backup, recovery, and file synchronization mechanism for small to medium sized network infrastructures. For those coming from legacy backup and recovery installations such as rsync, unison, and scp, OwnCloud is heaven sent.

However like everything Linux, it requires a substantial quantity of time to install. Equally if not more, it demands post installation procedures which are confounding for the most part.

There are solutions provided online, that is without question. After all, that  is the point of the entire open source framework — simultaneous development and lightning fast sharing. However, the sheer volume and variety of situations and solutions make searching for the right “way” quite impossible.

In my case, it took me two entire days to put this procedure down in the most direct and simple way.

OwnCloud 9 and Centos 7

OwnCloud does not come a default repository or package in CentOS 7. However, as previously mentioned everything in Linux, especially those that pertain to low level programming, is difficult to say the least.

Prerequisites

Listed below are the preliminary systems required to install OwnCloud. Caveta emptor: I will specifically focus on OwnCloud because the installation procedures for HTTPD/PHP/MySQL or MariaDB are are discussed in the previous posts.

  1. Apache HTTPD
  2. PHP
  3. MySQL / MariaDB
  4. OwnCloud Repository

OwnCloud 9

  1. Import their release key with the rpm command. This authorizes yum to trust the repository.
    $sudo rpm –import https://download.owncloud.org/download/repositories/stable/CentOS_7/repodata/repomd.xml.key
  2. Use curl command to download the ownCloud repository file:
    $sudo curl -L https://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -o /etc/yum.repos.d/ownCloud.repo
  3. After adding the new file, use the clean command to make yum aware of the change:$sudo yum clean expire-cache
  4. Perform the installation of ownCloud using the yum utility and the install command:
    $yum install owncloudStep four automatically creates the owncloud directory in /var/www/html

Warning

It is standard practice for Linux administrators to dig straight to the config file to plug in the database credentials and other matters. With OwnCloud, DO NOT DO THIS. I repeat, DO NOT alter the configuration file (/var/www/html/config/config.php) at this stage! it will break OwnCloud.

Also, should you encounter any problems during installation and think that you can merely $yum remove owncloud then delete the the diretory at /var/www/htlm/owncloud to have a clean server in preparation for a fresh install, it WILL NOT SOLVE the problem. I did this already. Yum will definitely delete the OwnCloud utility but it will not reset the owncloud directory. DO NOT DELETE THE OWNCLOUD DIRECTORY at /var/www/html. A fresh installation of OwnCloud via yum will not recreate it.

Be warned.

Problems and Solutions

The installation is straight forward however there are issues that occur when OwnCloud is accessed via the browser.

Issue: Can’t write into config directory

Owncloud issue: Can't write into config directory
Owncloud issue: Can’t write into config directory

Solution: Modify the SELinux Configuration with these commands

$semanage fcontext -a -t httpd_sys_rw_content_t ‘/var/www/html/owncloud/data’
$restorecon ‘/var/www/html/owncloud/data’
$semanage fcontext -a -t httpd_sys_rw_content_t ‘/var/www/html/owncloud/config’
$restorecon ‘/var/www/html/owncloud/config’
$semanage fcontext -a -t httpd_sys_rw_content_t ‘/var/www/html/owncloud/apps’
$restorecon ‘/var/www/html/owncloud/apps’

Full documenation here: https://doc.owncloud.org/server/8.0/admin_manual/installation/selinux_configuration.html

Restart HTTPD:

$service httpd restart

Issue: SQLSTATE[28000] Access denied to root

 SQLSTATE[28000] Access denied to root
SQLSTATE[28000] Access denied for root

Solution: Edit the config file

$vi /var/www/html/owncloud/config/config.php

Add your root password manually.

OwnCloud Config -- Add your password directly
OwnCloud Config — Add your password directly

 

Issue: 512 Max Upload Size

This one is a bit tricky but let me provide you a very simple solution. First of, you have to edit three (3) files. To wit, they are as follows:

  1. /etc/php.ini
  2. /var/www/html/owncloud/.htaccess
  3. /var/www/html/owncloud/.user.ini

Append or provide the following lines:

  1. .htaccess
    1. php_value upload_max_filesize = 16G
    2. php_value post_max_size = 16G
    3. php_value max_input_time 3600
    4. php_value max_execution_time 3600
  2. php.ini
    1. upload_max_filesize = 16G
    2. post_max_size = 16G
    3. max_input_time 3600
    4. max_execution_time 3600

Full documentation here: https://doc.owncloud.org/server/7.0/admin_manual/configuration/big_file_upload_configuration.html

Conclusion:

The aforementioned guides and workarounds are implemented in my production server.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *