how to install and configure owncloud on centos 7

20
How to install and configure ownCloud on CentOS 7 popular client-server software for creating and using file hosting services. Using it, one can create a private cloud server instead of relying on paid services like Dropbox, OneDrive, pCloud, etc.. The significant advantage of using ownCloud is the cloud size you get. Its size is limited by your hard disk capacity! With hard disks so much affordable these days, you can create a terabyte’s worth of cloud server at a fraction of a cost compared to paid cloud services. Install and Configure ownCloud on CentOS 7 Login to Terminal as root and start firing up the commands below. Step 1 – Disable SELinux Open SELinux configuration and edit the file: vim /etc/sysconfig/selinux Change “SELINUX=enforcing” to “SELINUX=disabled” Save and exit the file. Then reboot the system. reboot Step 2 – Install and Configure Apache Use the following commands: yum -y install httpd mod_ssl Check service status. systemctl status httpd.service If Apache service is not running, start it manually. systemctl start httpd.service Enable httpd service on system boot. systemctl enable httpd Run the following command to configure the firewall for Apache.

Upload: others

Post on 25-Apr-2022

29 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: How to install and configure ownCloud on CentOS 7

How to install and configure ownCloud on CentOS 7 popular client-server software for creating and using file hosting services. Using it, one can create a private cloud server instead of relying on paid services like

Dropbox, OneDrive, pCloud, etc.. The significant advantage of using ownCloud is the cloud size you get. Its size is limited by your hard disk capacity! With hard disks so much affordable these days,

you can create a terabyte’s worth of cloud server at a fraction of a cost compared to paid cloud services.

Install and Configure ownCloud on

CentOS 7

Login to Terminal as root and start firing up the commands below.

Step 1 – Disable SELinux

Open SELinux configuration and edit the file:

vim /etc/sysconfig/selinux

Change “SELINUX=enforcing” to “SELINUX=disabled”

Save and exit the file. Then reboot the system.

reboot

Step 2 – Install and Configure Apache

Use the following commands:

yum -y install httpd mod_ssl

Check service status.

systemctl status httpd.service

If Apache service is not running, start it manually.

systemctl start httpd.service

Enable httpd service on system boot.

systemctl enable httpd

Run the following command to configure the firewall for Apache.

Page 2: How to install and configure ownCloud on CentOS 7

firewall-cmd --add-service http --permanent

firewall-cmd --add-service https --permanent

firewall-cmd --reload

Step 3 – Configure Needed Repositories

Install epel and remi repos.

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

Disable PHP 5 repositories and enable PHP 7.2 repo.

yum-config-manager --disable remi-php54

yum-config-manager --enable remi-php72

Step 4 – Install PHP

yum install php php-mbstring php-gd php-mcrypt php-pear php-pspell php-

pdo php-xml php-mysqlnd php-process php-pecl-zip php-xml php-intl php-

zip php-zlib

Step 5 – Install MariaDB

yum --enablerepo=remi install mariadb-server

Start the MariaDB service.

systemctl start mariadb.service

Enable MariaDB on system boot.

systemctl enable mariadb

Run the following command to secure MariaDB.

mysql_secure_installation

Add a new root password and continue. Then it will ask a few questions. Type “Y” to agree to that.

Login to DB server and verify.

mysql -u root -p

Step 6 – Installing ownCloud

Page 3: How to install and configure ownCloud on CentOS 7

Create a repo file.

vim /etc/yum.repos.d/owncloud.repo

Add the following content to the file.

[ce_10.1]

name=wnCloud Server Version 10.1.x (CentOS_7)

type=rpm-md

baseurl=http://download.owncloud.org/download/repositories/production/C

entOS_7

gpgcheck=1

gpgkey=http://download.owncloud.org/download/repositories/production/Ce

ntOS_7/repodata/repomd.xml.key

enabled=1

Save and exit the file. List repositories using the following command:

yum repolist

Run clean command to make yum aware of the change.

yum clean expire-cache

Install ownCloud.

yum install owncloud

Step 7 – Create a Database for ownCloud

Create a database of your choice. You can replace the name fosslinuxocdb to anything you want.

create database fosslinuxocdb;

Create a DB user and grant privileges.

create user 'ownclouduser'@'localhost' identified BY

'de@34@dfE67diT90';

grant all privileges on fosslinuxocdb.* to ownclouduser@localhost ;

Flush privileges.

flush privileges;

Page 4: How to install and configure ownCloud on CentOS 7

Step 8 – Configuring Apache for ownCloud

Create a virtual host file.

vim /etc/httpd/conf.d/owncloud.conf

Add the following contents to the file. Make sure to replace the fosslinux names with the names you used.

<VirtualHost *:443>

ServerAdmin [email protected]

DocumentRoot "/var/www/html/owncloud/"

ServerName fosslinuxowncloud.com

ServerAlias www.fosslinuxowncloud.com

ErrorLog "/var/log/httpd/fosslinuxowncloud.com-ssl-error_log"

CustomLog "/var/log/httpd/fosslinuxowncloud.com-ssl-access_log"

combined

<Directory "/var/www/html/owncloud/">

DirectoryIndex index.html index.php

Options FollowSymLinks

AllowOverride All

Require all granted

</Directory>

SSLEngine On

SSLCertificateFile /etc/ssl/certs/fosslinuxowncloud.cer

Page 5: How to install and configure ownCloud on CentOS 7

SSLCertificateKeyFile /etc/ssl/certs/fosslinuxowncloud.key

SSLCertificateChainFile /etc/ssl/certs/fosslinuxowncloud.ca

</VirtualHost>

You can add your SSL certificates and point it to configurations.

SSLCertificateFile /etc/ssl/certs/certifiate-name.cer

SSLCertificateKeyFile /etc/ssl/certs/key-name.key

SSLCertificateChainFile /etc/ssl/certs/chain-cert.ca

Restart the Apache web server for the changes to take effect:

systemctl restart httpd

Step 9 – Configuring ownCloud

Open a web browser and browse the following address.

https://Domain name or IP

Then you will get a similar page as below.

Page 6: How to install and configure ownCloud on CentOS 7
Page 7: How to install and configure ownCloud on CentOS 7

owncloud-Configuration-Page Then create an admin account.

Page 8: How to install and configure ownCloud on CentOS 7

Create Admin

Page 9: How to install and configure ownCloud on CentOS 7

Account We didn’t modify Data folder hence we didn’t create a separate folder for it.

Add MariaDB details.

Page 10: How to install and configure ownCloud on CentOS 7

Add MariaDB Details

Page 11: How to install and configure ownCloud on CentOS 7

Then click on “Finish setup”, and it will configure the application.

Page 12: How to install and configure ownCloud on CentOS 7

Configuring Settings

Page 13: How to install and configure ownCloud on CentOS 7

Then it will redirect to login page. Use created an admin username and password to access ownCloud.

You will get a splash screen like below:

Page 14: How to install and configure ownCloud on CentOS 7
Page 15: How to install and configure ownCloud on CentOS 7

Splash-Screen After you close splash screen and you can see the ownCloud main window.

Page 16: How to install and configure ownCloud on CentOS 7
Page 17: How to install and configure ownCloud on CentOS 7

Owncloud Main-Interface

Step 10 – Install Owncloud Desktop Client

Enter the following commands to install the client on Centos 7.

Go to the repository folder.

cd /etc/yum.repos.d/

Add repository.

wget

https://download.opensuse.org/repositories/isv:ownCloud:desktop/CentOS_

7/isv:ownCloud:desktop.repo

Install client.

yum install owncloud-client

Then start the client and add ownCloud URL.

Open-Owncloud-Client Add user credentials and click next.

Page 18: How to install and configure ownCloud on CentOS 7

Add-User-info You can configure a local folder and sync settings.

Page 19: How to install and configure ownCloud on CentOS 7

Owncloud-Local-Folder-Options Click connect, and it will sync with the server.

Page 20: How to install and configure ownCloud on CentOS 7

Synchronizing-Status Now you can add files, images, etc. to a local folder and it will sync with the server.