Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

How To Install ownCloud 7 on CentOS 6.5


This document describes how to install and configure ownCloud 7 on CentOS 6.5. I will also connect to the ownCloud Server’s data with Ubuntu 14.04 desktop and windows 7 machine. ownCloud provides access to your data through a web interface or WebDAV while providing a platform to easily view, sync and share across devices—all under your control. ownCloud’s open architecture is extensible via a simple but powerful API for applications and plugins and works with any storage.

1 Preliminary Note

This tutorial is based on CentOS 6.5 server, so you should set up a basic CentOS 6.5 server installation before you continue with this tutorial. The system should have a static IP address. I use 192.168.0.100 as my IP address in this tutorial and server1.example.com as the hostname. Again I have  192.168.0.101 as IP address of Ubuntu 14.04 Desktop and server2.example.com as the hostname. I will be using the user=srijan for the installation and configuration. I will also show the ownCloud sharing options with windows machine, so I have working Windows 7 machine too.

 

2 Installation of ownCloud 7

ownCloud is a web application that can store and serve content from a centralized location, much like Dropbox. The difference is that ownCloud 7 allows you to host the serving software on your own machines, taking the trust issues out of putting your personal data someone else’s server.

We will first download the release key associated with the ownCloud software:

cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo

Then we need to add epel repository too:

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Finally, update the package database and install ownCloud:

yum install owncloud

ownCloud will install Apache with its dependency, if it doesn’t get installed automatically manually install httpd:

yum install httpd

Apache must restart at every boot so we will add it to chkconfig as:

chkconfig –levels 235 httpd on
/etc/init.d/httpd start

Further we need to allow SELINUX with apache at http and https as follows:

setup

own1

Select Firewall configuration:

own2

Select Cutomize:

own4

Allow for Secure WWW (HTTPS) and WWW (HTTP) further save and exit:

own5

3 ownCloud 7 configuration on CentOS 6.5

Further we need to install Mysql to get the configurations as follows:

yum install mysql-server

chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start

We will be configuring our ownCloud server to take advantage of the more robust MySQL database instead of the SQLite default implementation. To do so, we must configure MySQL first as:

mysql_secure_installation

[root@server1 ~]# mysql_secure_installation

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

In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, 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 MySQL
root user without the proper authorisation.

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

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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, MySQL 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 MySQL
installation should now be secure.

Thanks for using MySQL!

Now moving towards the Mysql prompt:

mysql -u root -p

Put the Mysql password which you selected before, & create a database for ownCloud in Mysql prompt:

CREATE DATABASE owncloud;

Assign privileges to a new MySQL user to handle database operations for ownCloud:

GRANT ALL ON owncloud.* to ‘owncloud’@’localhost’ IDENTIFIED BY ‘database_password’;

exit

Now, if you go to your IP address or domain name followed by “/owncloud” in your browser, you will see a page that looks like this:

1

Click on Storage & database:

2

Now select MySQL/MariaDB and create an admin account as in my case I have choosen owncloud as my admin account and a desired password for that user:

5

In the lower tab below the MySQL/MariaDB give the entry of the username=owncloud password=database_password databasename=owncloud.

Then press Finish setup.

6

own5

4 Mounting the ownCloud 7 share with Ubuntu 14.04 Desktop

We can mount the shared point with the other machines, here I will show you the way to process to moint it through WebDAV tools in another Ubuntu Desktop machine. There are two methods to use ownCloud 7 as a client in Ubuntu Desktop.

  • Manual mount by giving entries installing davfs2
  • By installing ownCloud 7 client

I will explain both of them, you can use any of them to mount.

4.1 Manual mount through davfs2

I am running the command on my second machine server2.example.com:

sudo apt-get update

sudo apt-get install davfs2

We will allow non-root users to mount and unmount the WebDAV shares by typing:

sudo dpkg-reconfigure davfs2

Should unprivileged users be allowed to mount WebDAV resources? <–Yes

Moving ahead I will be adding my username=srijan to WebDAV group:

 sudo usermod -aG davfs2 srijan

We want to make the permanent mount point in server2.example.com, so I will give the following entries in the /etc/fstab:

sudo vi /etc/fstab

[…]
192.168.0.100/owncloud/remote.php/webdav /home/srijan/owncloud davfs user,rw,noauto 0 0

Now in user=srijan‘s home drive I will create directories, one to mount the share point and another to hold the configurations details:

mkdir ~/owncloud

 mkdir ~/.davfs2

Further create a file as:

vi ~/.davfs2/secrets

192.168.0.100/owncloud/remote.php/webdav owncloud database_password

Ensure that the file is writable by only you by using the file manager or by issuing the following command:

chmod 600 ~/.davfs2/secrets

Now we will mount it as follows:

mount owncloud/

srijan@server2:~$ sudo mount owncloud/
Please enter the username to authenticate with server
192.168.0.100/owncloud/remote.php/webdav/ or hit enter for none.
Username: owncloud
Please enter the password to authenticate user owncloud with server
192.168.0.100/owncloud/remote.php/webdav/ or hit enter for none.
Password:  database_password
srijan@server2:~$

Note: The given credentials will be used further, so please take a note of it:

Username: owncloud
Password: database_password

Further if you find any permissions error in the folder then change the folder permission as owner of the user:

chown -R srijan:srijan owncloud/

To automatically mount the folder on login at server2.example.com, add the mount ~/owncloud command to the ~/.bashrc file.

vi ~/.bashrc

[...]
mount ~/owncloud

After mounting successfully you can get some error Resource temporarily unavailable and Certificate warnings then it can be removed as follows:

  • For Resource temporarily unavailable:

vi /etc/davfs2/davfs2.conf

[...]
use_locks 0
  • For Certificate warnings:

If you use a self-signed certificate, you will get a warning. If you are willing to take the risk of a man in the middle attack, run this command instead:

echo “y” | mount ~/owncloud > /dev/null 2>&1

4.2 ownCloud 7 client installation by ownCloud

Open link and select the distribution Ubuntu 14.04, further in your Ubuntu Desktop put the commands:

cd /tmp
wgethttp://download.opensuse.org/repositories/isv:ownCloud:desktop/xUbuntu_14.04/Release.key
sudo apt-key add – < Release.key

sudo sh -c “echo ‘deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/xUbuntu_14.04/ /’ >> /etc/apt/sources.list.d/owncloud-client.list”
sudo apt-get update
sudo apt-get install owncloud-client

It will install ownCloud-client in the Ubuntu 14.04 Desktop. Thats it open ownCloud-client

24

Put the server path as 192.168.0.100/owncloud and then put your credentials of username=owncloud  and password=database_password

27

Further if you are using it without https theen you can ignore the error and move ahead:

28

Again:

29
Then it will map the ownCloud with your dekstop:

30

And then finally all data will get synced:

31

 

5 Mounting the ownCloud 7 share with Windows 7

We can access the data from ownCloud 7 server on a window machine also. There are many methods to this, you can check this link for them. I will explain two of them.

  1. I will be using the ownCloud clients for that. Open link and download the windows client from here

Simply install the client and it will work for you.

17

 

Enter the details http://192.168.0.100/owncloud:

18

Again give your credentials( user=owncloud and password=database_password) which we have settup while installing the ownCloud 7 and the window will appear:

20

You can open the local folder to access the files locally.

  1. Cyberduck ver 4.5.

There is another method to access the ownCloud 7 server. I will be using Cyberduck for that. For this you need to install it from this URL.

Download the installer and install it simply by doing next –next.

8

Cyberduck has a very nice user interface.

10

Enter the credentials & connect 192.168.0.100/owncloud/remote.php/webdav with user=owncloud and password=database_password:

13

Give the credentials and it will connect.

14

  • ownCloud 7 : https://owncloud.com/
  • Cyberduck : http://cyberduck.io/?l=en
  • CentOS  : http://www.centos.org/

 

Comments

comments