Steps to Install ownCloud 8.2 on CentOS 7

ownCloud is an open source software which allows us to set up our private ‘file-hosting’ cloud or we can say ‘cloud storage’ over the network. Data hosted in ownCloud can be access at any time either via web browsers or desktop client or may be via smart phone aaps.

Some of the important features of ownCloud are listed below :

owncloud-features

In this article we will install ownCloud 8.2 on CentOS 7. Hostname and ip address of my CentOS 7 machine is “owncloud.linuxtechi.com” & “192.168.1.101″

Following are the prerequisites for ownCloud.

  • PHP
  • Apache Web Server ( Apache )
  • Database Server ( MariaDB or SQLite or Oracle or PostgreSQL )

Step:1 Install PHP and Web Server (HTTPD)

Use below yum command to install php and apache web server (httpd) and other PHP dependencies.

[[email protected] ~]# yum install httpd php php-mysql sqlite php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-gd curl php-curl php-mcrypt php-pear

Start the Web Server service

[[email protected] ~]# systemctl start httpd.service
[[email protected] ~]# systemctl enable httpd.service
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
[[email protected] ~]#

Step:2 Install and Configure Database for ownCloud.

In CentOS 7 MariaDB is the default database server.

[[email protected] ~]# yum install mariadb-server mariadb

Start the Database Service

[[email protected] ~]# systemctl start mariadb.service
[[email protected] ~]#
[[email protected] ~]# systemctl enable mariadb.service
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
[[email protected] ~]#

Set the Root password and other database parameters using below command :

[[email protected] ~]# mysql_secure_installation

Create the database (owncloud_db).

[[email protected] ~]# mysql -u root -p
Enter password:

MariaDB [(none)]> create database owncloud_db;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>

Create a database user(dbuser) and grant all the privileges on the database (owncloud_db)

MariaDB [(none)]> grant all on owncloud_db.* to 'dbuser'@'localhost' identified by '[email protected]#';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye
[[email protected] ~]#

Step:3 Install ownCloud package using yum command.

ownCloud Package is not available in the default yum repositories so we will set below EPEL and ownlcoud repositories.

Note : Install wget package in case it is not installed on your system.

[[email protected] ~]# yum install wget
[[email protected] ~]# rpm -Uhv http://dl.fedoraproject.org/pub/epel/7/$(uname -i)/e/epel-release-7-5.noarch.rpm
[[email protected] ~]# wget http://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo
[[email protected] ~]# yum install owncloud

Allow Web Server’s port in the OS(Operating System) firewall.

[[email protected] ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[[email protected] ~]# firewall-cmd --permanent --zone=public --add-service=https
success
[[email protected] ~]# firewall-cmd --reload
success
[[email protected] ~]#

Set the required permissions on ownlcoud folder “/var/www/html/owncloud

[[email protected] ~]# chown -R apache.apache /var/www/html/owncloud/
[[email protected] ~]#

Set the below SELinux Rules if SELinux is enabled on your system

[[email protected] ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/data'
[[email protected] ~]# restorecon '/var/www/html/owncloud/data'
[[email protected] ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/config'
[[email protected] ~]# restorecon '/var/www/html/owncloud/config'
[[email protected] ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/apps'
[[email protected] ~]# restorecon '/var/www/html/owncloud/apps'
[[email protected] ~]#

Step:4 Start ownCloud Installation from the Browser.

To start the ownCloud installation open the web browser and type :

http://192.168.1.101/owncloud/

Replace the ip address as per your setup.

Specify the User name as ‘admin’ and give password that you want set for admin user. Data Folder as ‘/var/www/html/owncloud/data’ and Database name (owncloud_db) and database user (dbuser) credentials that we created in above steps.

ownCloud-installation-scree

Click on ‘Finish setup’

Files-ownCloud-CentOS7

Get ownCloud Clients and aaps to sync your data.

Home Page of Our ownCloud will look like below.

Home-Page-ownCloud

Installation and Configuration of ownCloud is completed. Now upload data and share it among users.

By Default only 513MB data file can be uploaded in case you want to change this limit , edit the file ‘/var/www/html/owncloud/.htaccess‘ and set the limit as per requirement.

maximum-upload-limit-owncloud

1 Response

  1. Asep Saepuloh says:

    Thank’s is very helpful

Leave a Reply

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

Pin It on Pinterest