20 C
Texas
angeloma
Senior Writer and partner

How to install ownCloud in CentOS 7?

It is becoming more and more common to read and hear about security breaches from companies that handle vital user information on the Internet, and this makes many people wonder whether it is so necessary to trust these giant companies.

Another important issue is that these large companies do not take the issue of privacy seriously and their handling of user files and information is at least questionable.

Therefore, many users and small businesses prefer to invest in infrastructure that allows them to have their private cloud. At the software level, owncloud is emerging as the most important solution in this matter.

OwnCloud is a software that allows us to create a private cloud with which you can synchronize files, calendar, contacts, notes and more using extensions. It’s free, open source and has an application for Android, iOS and desktop client for Linux, Windows and Mac OS X.

Installing OwnCloud on our CentOS 7 server

1.-Upgrading the system

- Advertisement -

Normally when starting an installation process for this type of application, we need to update the system. For that:

            sudo -i

Enter your password and you will be a root user

            yum update

1.- Upgrading CentOS
1.- Upgrading CentOS

Once this is done, we can continue with the installation with the certainty of having all the security updates available.

2.-Installing Apache

In order to run it, a web server is required, in this case we will install apache.

                yum install httpd

2- Installing apache
2- Installing apache

Now we must start the service and enable it to run when the system starts.

            systemctl start httpd

and:

           systemctl enable httpd

3.- Starting and enabling apache
3.- Starting and enabling apache

For all this to work, we have to open the http ports in the firewall:

             firewall-cmd –permanent –zone=public –add-service=http

and:

            firewall-cmd –permanent –zone=public –add-service=https

Finally:

           firewall-cmd –reload

4.- Opening ports at firewall
4.- Opening ports at firewall

When accessing from our favorite web browser, to the server ip, we should see the apache test page, indicating that the process has been done correctly.

              http://IP_SERVER

5.- Testing apache
5.- Testing apache

3.-It is now up to MariaDB

Owncloud requires a DBMS and the one chosen in this case is MariaDB. We proceed to install it:

              yum install mariadb-server mariadb

6.- Installing mariadb
6.- Installing mariadb

As with apache, you need to activate and enable the service.

             systemctl start mariadb

and:

            systemctl enable mariadb

7.- Starting and enabling mariadb service
7.- Starting and enabling mariadb service

Next we’ll use the configuration script to set root password and more.

               mysql_secure_installation

8.-mysql_secure_installation
8.-mysql_secure_installation

To the questions we will answer: Y,n,y,y,y

9.- mysql_secure_installation
9.- mysql_secure_installation

The next thing is to create the database that will use owncloud, for this we access the MariaDB console.

            mysql -u root -p

And once inside, we execute the sentence:

             CREATE DATABASE owncloud;

10.- Creating the database
10.- Creating the database

Then we’ll create the user that will have permissions on that database.

              GRANT ALL PRIVILEGES ON owncloud.* TO ‘ownclouduser’@’localhost’ IDENTIFIED BY ‘owncloudpss’;

Don’t forget to change your username and password. Now we refresh the permissions and exit the mariadb console.

              FLUSH PRIVILEGES;

              exit;

12.- Refreshing privileges
12.- Refreshing privileges

4.-Adding owncloud repository

Before adding the owncloud repository, we must activate the EPEL repository and install some dependencies:

             yum install wget

Next:

             wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

13.- Adding EPEL repository
13.- Adding EPEL repository

And we proceed to install the downloaded package:

             rpm -Uvh epel-release-latest-7.noarch.rpm

Now, we checked that the repository was added correctly.

            yum repolist

14.- Repolist
14.- Repolist

As we can see it has been added correctly.

With EPEL added we can install some OwnCloud dependencies:

            yum –enablerepo=epel -y install php php-pear-MDB2-Driver-mysqli php-pear-Net-Curl

15.- Installing dependecies
15.- Installing dependecies

As we can see, these dependencies include php.

Now we proceed to add the Owncloud repository:

wget http://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -P /etc/yum.repos.d

16.- Adding owncloud repository
16.- Adding owncloud repository

And we proceed to install it:

           yum -y install owncloud          

17.- Installing owncloud package
17.- Installing owncloud package

Finally, we restart Apache.

            systemctl restart httpd

If we have SELINUX Enabler we must run these commands to give owncloud permissions.

             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/config

             restorecon /var/www/html/owncloud/apps

             restorecon /var/www/html/owncloud/config

18.- SELINUX permission
18.- SELINUX permission

At this point, if we try to access the web interface, we will encounter this error:

19.- Error
19.- Error

It tells us the bug that we need to upgrade php to a higher version but not 7.3.

5.-Upgrading php

As it was said, we need to update the version of php that comes in CentOS. First we add the REMI repository:

              yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

20.- Adding REMI repository
20.- Adding REMI repository

We must also install the package yum-utils

               yum install yum-utils

21.- Installing yum-utils
21.- Installing yum-utils

Now we enable the repository and update the system:

            yum-config-manager –enable remi-php72

and:

            yum update

22.- Upgrading system
22.- Upgrading system

We install the necessary php modules for owncloud:

              yum install php-gd php-zip php-mbstring php-intl

As we can see, php is updated with the command. Then, we restart Apache.

              systemctl restart httpd

6.-Completing the installation through the web interface

At this point we can complete the configuration from the web browser:

             http://IP_SERVER/owncloud

 

23.-Welcome page owncloud
23.-Welcome page owncloud

And we introduce the parameters of mariadb that we have done before. In addition to creating the administrator account.

Once the process is complete, you will be asked for your password to enter the application.

24.- Logging screen
24.- Logging screen

We enter the username and password and the application is displayed as such.

25.- Owncloud
25.- Owncloud

And owncloud is already installed and we can start to take advantage of it.

Owncloud is important for many small and medium businesses that do not want to have their files entrusted to third parties with the advantage of being the full owner of the privacy of the server that contains them.

Don’t forget to share this article through social networks.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article