How to Install ownCloud on CentOS 7

OwnCloud is open source application for file sharing similar to Dropbox. Using this application we can store and access our data across all of your devices and share your files with others as well. Frank Karlitschek made the application and release its initial release in 2010. OwnCloud has 2 licenses: community and enterprise licenses and this article will explain how to install community version of ownCloud on CentOS 7.

As of the writing, the community version of ownCloud is up to version 10.0.3. Before we install it on our server, please disable first SELinux and firewall on our server. OwnCloud requires some packages that should be on the server such as the database such as MySQL or MariaDB, PHP version 5.6 above and server (nginx/apache). Actually, ownCloud uses SQLite as the database but we will use MariaDB, Apache, and PHP 5.6 database to install ownCloud.

Type the commands below to install the required packages:

# yum install -y epel-release
# rpm -Uvh
# yum install -y php56 php56-php php56-php-gd php56-php-mbstring php56-php-mysqlnd php56-php-mcrypt php56-php-intl httpd mariadb-server mariadb unzip wget

And then we download package ownCloud and configure database MariaDB:

# wget --no-check-certificate
# unzip
# cp -R owncloud /var/www/html
# cd /var/www/html
# chown -R apache.apache owncloud
# chmod -R 755 owncloud
# systemctl start httpd
# systemctl enable httpd
# systemctl start mariadb.service
# systemctl enable mariadb.service
# mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE owncloud;
MariaDB [(none)]> GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY '123456';
MariaDB [(none)]> \q

Now access ownCloud on the web server with type below on the browser:

Then there will be display as follows:
First, we create username and password according to what we want and I create admin as the username of the ownCloud:
And then we configure database. Click Storage & database and we choose MySQL/MariaDB and we fill it according to what we have previously configured:

Click Finish Setup, there will be display as follows:
Push Enter button and there will be display as follows:
If we want to upload the file, click plus sign and choose Upload:
Select the file to upload then the upload process will run:
The file will successfully upload properly if no problem:
If we want to add a new user, then click admin and choose Users:
Then there will be display as follows:
Click Add Group and fill in the name of the group we want example Users:
After that, we create a new user like this:
We created the new user and we configure a quota for the user:
Sometimes we want to change IP address on the server, but when we access ownCloud, there is the error like this:
You are accessing the server from an untrusted domain.
Please contact your administrator.If you are an administrator of this instance, configure the “trusted_domains”
setting in config/config.php. An example configuration is provided in config/config.sample.php.
To solve this,we must go to /var/www/html/owncloud/config/ and open config.php. In the file, we change the file by changing the new IP address as in the picture below:

If we use SELinux on the server, please type the following 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(/.*)?'
# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/.htaccess'
# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/.user.ini'
# restorecon -Rv '/var/www/html/owncloud/'
# setsebool -P httpd_can_network_connect_db 1



Leave a Reply

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