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.
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.
- Apache HTTPD
- MySQL / MariaDB
- OwnCloud Repository
- 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
- 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
- After adding the new file, use the clean command to make yum aware of the change:$sudo yum clean expire-cache
- 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
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.
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
Solution: Modify the SELinux Configuration with these commands
$semanage fcontext -a -t httpd_sys_rw_content_t ‘/var/www/html/owncloud/data’
$semanage fcontext -a -t httpd_sys_rw_content_t ‘/var/www/html/owncloud/config’
$semanage fcontext -a -t httpd_sys_rw_content_t ‘/var/www/html/owncloud/apps’
Full documenation here: https://doc.owncloud.org/server/8.0/admin_manual/installation/selinux_configuration.html
$service httpd restart
Issue: SQLSTATE Access denied to root
Solution: Edit the config file
Add your root password manually.
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:
Append or provide the following lines:
- php_value upload_max_filesize = 16G
- php_value post_max_size = 16G
- php_value max_input_time 3600
- php_value max_execution_time 3600
- upload_max_filesize = 16G
- post_max_size = 16G
- max_input_time 3600
- max_execution_time 3600
Full documentation here: https://doc.owncloud.org/server/7.0/admin_manual/configuration/big_file_upload_configuration.html
The aforementioned guides and workarounds are implemented in my production server.