DEV Community

Cover image for OwnCloud Setup for Fedora Based System
Shubham Singh
Shubham Singh

Posted on

OwnCloud Setup for Fedora Based System

[1] Installing Dependence

Apache (HTTP server)

sudo dnf install httpd
sudo systemctl enable httpd.service
sudo systemctl start httpd.service
Enter fullscreen mode Exit fullscreen mode

add HTTP server to firewall exclusion

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
Enter fullscreen mode Exit fullscreen mode

MariaDB

sudo dnf install mariadb-server
sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service
Enter fullscreen mode Exit fullscreen mode

Secure your database installation

pressing y for every thing is ok

/usr/bin/mysql_secure_installation
Enter fullscreen mode Exit fullscreen mode
 mysql_secure_installation

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): **<ENTER>**
OK, successfully used password, moving on...

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

Set root password? [Y/n] **<ENTER>**
New password: **Your_Password_Here**
Re-enter new password: **Your_Password_Here**

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] **<ENTER>**
 ... 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] **<ENTER>**
 ... 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] **<ENTER>**

 - 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] **<ENTER>**
 ... 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!
Enter fullscreen mode Exit fullscreen mode

Install PHP

make sure to check the required version for your OwnCloud version, can be checker using this php -v

sudo dnf install php php-common php-mysqlnd php-xml php-json php-gd php-mbstring
Enter fullscreen mode Exit fullscreen mode

restart HTTP server

sudo systemctl restart httpd
Enter fullscreen mode Exit fullscreen mode

[2] Get OwnCloud

latest OwnCloud can be found on OwnCloud web page here, copy the tar download link

cd /var/www
wget <link>
Enter fullscreen mode Exit fullscreen mode

I'm using v10.8.0, so my download link is #https://download.owncloud.org/community/owncloud-10.8.0.tar.bz2

extract files and set the required permission

tar xjf owncloud-10.8.0.tar.bz2
Enter fullscreen mode Exit fullscreen mode
chown -R apache.apache owncloud
chmod -R 755 owncloud
Enter fullscreen mode Exit fullscreen mode

remove the .tar file

rm -f owncloud-10.8.0.tar.bz2
Enter fullscreen mode Exit fullscreen mode

[3] Setup For Database

make sure you are login as root

mysql -u root -p
Enter fullscreen mode Exit fullscreen mode

enter your root password, and you should be in the database command line interface

CREATE DATABASE owncloud;
GRANT ALL ON owncloud.* to 'root'@'localhost' IDENTIFIED BY '
<password>';
FLUSH PRIVILEGES;
quit
Enter fullscreen mode Exit fullscreen mode

now you should be able to open up the webpage at localhost/owncloud

to access own cloud from the web, you have to add the domain name or the server public IP in the configuration PHP

path for the configuration file is /var/www/owncloud/config/config.php

under trusted domain add your domain/IP

  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'www.example.com',
    2 => '<your public ip>'
  ),
Enter fullscreen mode Exit fullscreen mode

if the configuration is correct, your OwnCloud should be online at <ip/domin>/owncloud

Top comments (0)