How to Install ownCloud 9.0 in CentOS 7

To Install ownCloud 9.0 on CentOS 7

OwnCloud is a free software to set up our private ‘ file-hostingcloud. It can be accessed through a web browsers or desktop client. Installation of ownCloud 9.0 on CentOS 7 is explained in this article.


To install Owncloud

Install php and webserver

[root@linuxhelp1 ~]# yum install httpd php php-mysql php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-gd php-curl php-pear -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.webwerks.com
 * extras: centos.webwerks.com
 * updates: centos.webwerks.com
Resolving Dependencies
-->  Running transaction check
--->  Package httpd.x86_64 0:2.4.6-40.el7.centos.1 will be installed
--->  Package php.x86_64 0:5.4.16-36.1.el7_2.1 will be installed
-->  Processing Dependency: php-cli(x86-64) = 5.4.16-36.1.el7_2.1 for package: php-5.4.16-36.1.el7_2.1.x86_64
--->  Package php-common.x86_64 0:5.4.16-36.1.el7_2.1 will be installed
.
.
.
Installed:
  httpd.x86_64 0:2.4.6-40.el7.centos.1                       php.x86_64 0:5.4.16-36.1.el7_2.1                       
  php-common.x86_64 0:5.4.16-36.1.el7_2.1                    php-gd.x86_64 0:5.4.16-36.1.el7_2.1                    
  php-mbstring.x86_64 0:5.4.16-36.1.el7_2.1                  php-mysql.x86_64 0:5.4.16-36.1.el7_2.1                 
  php-pdo.x86_64 0:5.4.16-36.1.el7_2.1                       php-pear.noarch 1:1.9.4-21.el7                         
  php-xml.x86_64 0:5.4.16-36.1.el7_2.1                      

Dependency Installed:
  php-cli.x86_64 0:5.4.16-36.1.el7_2.1                   php-process.x86_64 0:5.4.16-36.1.el7_2.1                  

Complete!

Install mariadb

[root@linuxhelp1 ~]# yum install mariadb mariadb-server -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.webwerks.com
 * extras: centos.webwerks.com
 * updates: centos.webwerks.com
Resolving Dependencies
-->  Running transaction check
--->  Package mariadb.x86_64 1:5.5.47-1.el7_2 will be installed
.
.
.
Installed:
  mariadb.x86_64 1:5.5.47-1.el7_2                       mariadb-server.x86_64 1:5.5.47-1.el7_2                      

Complete!

Start and enable http, mariadb service

[root@linuxhelp1 ~]# systemctl start httpd.service
[root@linuxhelp1 ~]# systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@linuxhelp1 ~]# systemctl start mariadb.service
[root@linuxhelp1 ~]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

Set the Root password and other database parameters

[root@linuxhelp1 ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we' ll need the current
password for the root user.  If you' ve just installed MariaDB, and
you haven' t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
 ... Success!
Normally, root should only be allowed to connect from ' localhost' .  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
 ... Success!
By default, MariaDB comes with a database named ' test'  that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
 ... Success!
Cleaning up...
All done!  If you' ve completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

Create database and user for owncloud

[root@linuxhelp1 ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with   or g.
Your MariaDB connection id is 11
Server version: 5.5.47-MariaDB MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.
MariaDB [(none)]>  create database owncloud 
Query OK, 1 row affected (0.02 sec)
MariaDB [(none)]>  grant all on owncloud.* to user1@localhost identified by ' linuxc'  
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>  flush privileges 
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>  exit 
Bye

Now install epel repository

[root@linuxhelp1 ~]# yum install epel-release -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.webwerks.com
 * extras: centos.webwerks.com
 * updates: centos.webwerks.com
Resolving Dependencies
-->  Running transaction check
--->  Package epel-release.noarch 0:7-6 will be installed
.
.
.
Installed:
  epel-release.noarch 0:7-6                                                                                         

Complete!

Install the repo for downloading own cloud

[root@linuxhelp1 ~]# wget http://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo
--2016-07-11 16:52:40--  http://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo
Resolving download.owncloud.org (download.owncloud.org)... 188.40.68.177, 148.251.209.106, 144.76.105.220, ...
Connecting to download.owncloud.org (download.owncloud.org)|188.40.68.177|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 265
Saving to: ‘ /etc/yum.repos.d/ce:stable.repo’ 

100%[==========================================================================> ] 265         --.-K/s   in 0s      

2016-07-11 16:52:40 (21.4 MB/s) - ‘ /etc/yum.repos.d/ce:stable.repo’  saved [265/265]

Install the owncloud, by running the following command.

[root@linuxhelp1 ~]# yum install owncloud -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.webwerks.com
 * epel: ftp.yzu.edu.tw
 * extras: centos.webwerks.com
 * updates: centos.webwerks.com
ce_stable                                                                                                       5/5
Resolving Dependencies
-->  Running transaction check
--->  Package owncloud.noarch 0:9.0.3-2.1 will be installed
-->  Processing Dependency: owncloud-deps > = 9.0.3 for package: owncloud-9.0.3-2.1.noarch
-->  Processing Dependency: owncloud-files > = 9.0.3 for package: owncloud-9.0.3-2.1.noarch
.
.
.
Installed:
  owncloud.noarch 0:9.0.3-2.1                                                                                       

Dependency Installed:
  owncloud-deps-php5.noarch 0:9.0.3-2.1  owncloud-files.noarch 0:9.0.3-3.1  php-ldap.x86_64 0:5.4.16-36.1.el7_2.1

Complete!

Allow the web server port in the firewall

[root@linuxhelp1 ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@linuxhelp1 ~]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@linuxhelp1 ~]# firewall-cmd --reload
Success

Set the permissions on owncloud folder.

[root@linuxhelp1 ~]# chown -R apache.apache /var/www/html/owncloud/

Set the semanage for the own cloud directory.

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


To Start own cloud installation in web browser

Open the web browser and navigate to http://IP_address/owncloud/">http://< ip_address> /owncloud/

Enter the details for creating the admin account. Click on ‘ Finish setup’ .

Get ownCloud Clients and apps to sync your data.

Home Page of Our ownCloud appears as follows.

Comment
cero
Mar 05 2017
Thanks
Add a comment
FAQ
Q
Why do you use HTTP and not another protocol in Owncloud?
A
Because HTTP goes through every firewall and proxy in Owncloud.
Q
What version of php is used here?
A
Here the default version is installed

"Default version php 5.3.4"
Q
Why does ownCloud use csync rather than rsync?
A
To ensure old files get removed but new files added, and updated files overwritten, you need a N-to-N sync solution. ownCloud uses csync for syncing, which also deals with conflicts in a smart way.
Q
While accessing the web interface I am getting 403 Forbidden error?
A
Make sure the Apache document root is owned by apache user and group and also 775 permission.
Q
Where database connected to be made in Owncloud?
A
The database can be stored under this path
"/var/www/html/owncloud"