Google Plus

Setup your personal Cloud server in minutes using ownCloud

Written by SK on . Posted in Hosting, Linux tutorials, opensource, Software

ownCloud is a free Open Source software, used to setup your own personal cloud for file sharing, Calender, Contact and Bookmark sharing and Personal Audio/Video Streaming. It is pretty easy to setup and manage.

Prerequisites:

Make sure that your DNS server has properly installed and configured with your OwnCloud server IP and Hostname. For more information about configure DNS server follow this how-to tutorial.

In this tutorial i am using CentOS 6.3 minimal server to setup ownCloud.

Install the necessary packages for owncloud

[root@cloud ~]# yum -y install mysql-server httpd php php-mysql wget php-json php-xml php-mbstring php-zip php-gd curl php-curl php-pdo

Start mysql and httpd services and let them to start automatically on every reboot.

[root@cloud ~]# /etc/init.d/mysqld start
[root@cloud ~]# /etc/init.d/httpd start
[root@cloud ~]# chkconfig mysqld on
[root@cloud ~]# chkconfig httpd on

Adjust iptables to access owncloud server from outside of the network.

Add the following lines to the iptables config file and restart iptables.

[root@cloud ~]# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
[root@cloud ~]# service iptables restart

Now install and create mysql user and database for owncloud.

Note: In this tutorial i use password as “centos” for mysql database, owncloud admin account.

[root@cloud ~]# /usr/bin/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] y
New password:
Re-enter new password:
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] 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, 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] 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 MySQL
installation should now be secure.

Thanks for using MySQL!
[root@cloud ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.1.67 Source distribution
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE owncloud;
Query OK, 1 row affected (0.01 sec)
mysql> GRANT ALL ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'centos';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL ON owncloud.* TO 'owncloud'@'localhost.localdomain' IDENTIFIED BY 'centos';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye

Getting ownCloud

Goto to Apache root document folder and download the latest version of owncloud.

[root@cloud ~]# cd /var/www/html/
[root@cloud html]# wget http://owncloud.org/releases/owncloud-4.5.7.tar.bz2
--2013-03-11 13:50:50-- http://owncloud.org/releases/owncloud-4.5.7.tar.bz2
Resolving owncloud.org... 50.30.32.90
Connecting to owncloud.org|50.30.32.90|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9126728 (8.7M) [application/x-bzip]
Saving to: “owncloud-4.5.7.tar.bz2”
100%[======================================>] 9,126,728 46.4K/s in 1m 52s
2013-03-11 13:52:46 (79.3 KB/s) - “owncloud-4.5.7.tar.bz2” saved [9126728/9126728]

[root@cloud html]# tar xvf owncloud-4.5.7.tar.bz2
[root@cloud html]# rm owncloud-4.5.7.tar.bz2
[root@cloud html]# chown -R apache:apache owncloud
[root@cloud html]# chmod 750 owncloud/data/
[root@cloud html]# chmod 777 owncloud/config/

Find and edit the lines as shown below in “/etc/httpd/conf/httpd.conf” file.

[root@cloud html]# vi /etc/httpd/conf/httpd.conf

<Directory "/var/www/html">
     Options Indexes FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
</Directory>

Restart the httpd and mysqld services.

[root@cloud html]# /etc/init.d/mysqld restart
[root@cloud html]# /etc/init.d/httpd restart

Now goto any client system if your owncloud server doesn’t has GUI mode and access it by “http://ip-address or domain name/owncloud. The index page of own cloud will open now. Create the administrator username and password for your cloud server.

ownCloud - Mozilla Firefox_022

Files | ownCloud (admin) - Mozilla Firefox_023

Thats it. You can upload/download your images, files and Audio/Video here and you can access them from your clients over LAN/WAN.

For questions please refer to our Q/A forum at : http://ask.unixmen.com

SK

I'm Senthilkumar a.k.a SK, a Linux Admin & Tech blogger, based and raised in Tamilnadu, India. I love very much to write about Linux, Open Source, Computers and Internet to help newbies of Linux and Open Source world. Apart from that, i like to review Internet tools and web services which are helpful for me and as well as for my readers.
  • thiyagi

    I am just asking out of curiosity why Owncloud, why not just ftp or samba file server. If there is any advantage, plz mention it.. Pardon my stupidity if it is so..

    • http://www.facebook.com/profile.php?id=100000347815772 Nick Heywood

      Really thyagi, it’s just the Automatic syncronisation of files and services amongst invited users through a common framework or environment. Sort of like rsync on cronjob steroids. :)

  • http://www.facebook.com/profile.php?id=689444745 Alan McAlexander

    Hi Thiyagi,
    I’ll take a stab as I just stumbled upon this article and am in the process of setting up Owncloud (will wait for 5.0 though). Owncloud is like Dropbox, if you’re familiar with that. I’m implementing Owncloud for the company I work for. It will allow us to share files through a web browser, instead of ftp (which isn’t very secure) or samba (which again, has security problems if not configured properly). Owncloud enables you to sync data between your smartphone, tablet, computer AND share that same data with people, whether it is with teammates, business partners or clients. There’s a lot more to Owncloud than that by the way, but that is what I’m using it for.

    Also, check out bitnami.org, they have a .run file that will install Owncloud, it’s quick and very easy!

  • Pingback: Setup your personal Cloud server in minutes using ownCloud | Linux A.I

  • http://www.facebook.com/profile.php?id=100000347815772 Nick Heywood

    I apologise if the answer to my question is obvious, but it aint to me :) Why do we have to setup a DNS server? Can we not access ownCloud through http://ip_address/owncloud

    • http://www.facebook.com/profile.php?id=689444745 Alan McAlexander

      Hi Nick,
      You are correct, you can just access it through your solution…. BUT, DNS would make it so that you can access it through a name, not a bunch of numbers. With IPV6 coming on board, this will be VERY important. DNS is fairly easy to get going. If you haven’t yet, please check out pfsense.org, this is a firewall/router downloadable ISO that is based on BSD. I use it at home, at work and several friend’s houses. It does DHCP and DNS, is gui driven and very easy to get going. I run pfsense as VM’s in pretty much all my infrastructure.

      • Nick

        Thanks Alan. Speaking of VMs It seems using VMs is also a handy way to run ownCloud.

        • http://www.facebook.com/profile.php?id=689444745 Alan McAlexander

          That’s what I do at work and home, Owncloud runs as a VM on a Debian Linux base. If I need the extra space, it’s quite easy to mount NFS mount from a NAS or SAN (I use Mythbuntu that exports mounts at home) to the main storage directory that Owncloud uses. BTW, Owncloud 5.0 was released this morning!

      • pocoO

        Hi Alan,

        What virtualization software do you use? i use pfsense as well, but im thinking in use it as a vm too..any recomendations?

        thanks in advance

        • http://www.facebook.com/profile.php?id=100000347815772 Nick Heywood

          pocoO, for your info I now keep a VM image of a Ubuntu 12.04LTS Server constantly updated so I can deploy a, in my case and for my testing use, 768mb ram Ubuntu SSH/LAMP VM in minutes. Having one of these setups lying around on a hard drive or USB is invaluable if your unsure of how to or the value of an install on your system. The ip address asignment can get confusing though ;-) “HHHmm have I used .1.80 anywhere”? :)

          • pocoO

            Thanks for the info…

          • http://www.facebook.com/profile.php?id=689444745 Alan McAlexander

            Nick, You should check out turnkeylinux.org, I use to setup Nginx or apache, mysql, all that stuff by hand… now I just deploy a turnkey .iso Nginx, Mysql, php and cgi for everything. It’s good to learn by doing it from scratch…. but man does it save time just throwing a ready to rock .iso or VM. I hadn’t deployed Owncloud yet to the masses at work yet, was waiting for 5.0 to rollout, now that it has, I’m getting ready to rollout this at work and the turnkey basic distro is a time saver.

            http://www.turnkeylinux.org/nginx-php-fastcgi

          • http://www.facebook.com/profile.php?id=100000347815772 Nick Heywood

            I’ve had a look at turnkey a few times, and baulked at it. A lack of understanding I suspect. I like my independence :) But now? I have the confidence level to give it a fair run. Done! :) Good thought Alan, ‘ta

          • http://www.facebook.com/profile.php?id=100000347815772 Nick Heywood

            I’m not totally convinced about rolling ownCloud 5.0 out to the “great unwashed”. Been playing with it for a few weeks, and don’t seem to be able to some of the apps to install with out throwing errors. I’ll admit I haven’t chased down the problem in any depth at all. But the “great unwashed” are going to want to know everything is Kosher before it gets deployed, and I can’t do that right right now with out a “but” attached to any proposal :)

            I think it’s awesome. But then we’re not the sort of people to throw our hands up in the air, or bash the desk when something’s not behaving :)

        • http://www.facebook.com/profile.php?id=689444745 Alan McAlexander

          I use Proxmox, minus the reboot for the 2.2 update, I’ve been running for over 1 1/2 year with pfSense as a VM. My server has 32G RAM (a used Dell 2950) and the amount of VM’s I have on her pegs the used RAM at around 25G. No lag on my network, even with all this load. I’ve been happy with this setup. If you have 3+ servers, Proxmox also works well in a cluster setup, it’s quite easy to do and their Wiki is really nice.

          • pocoO

            Thanks for the quick and nice answer. Im using proxmox in and old computer as well :) but only i’m starting to test it with some “test” virtual machines … how many physical network cards do you use, and for the virtual pfsense? any special configuration in the virtual network switch of proxmox? thank you very much in advance. Tomorrow im going to test a pfsense in a spare server that i have at work..with proxmox too…(we need to change and old smoothwall sooner or later) (sorry for my bad english ;)

          • http://www.facebook.com/profile.php?id=689444745 Alan McAlexander

            I have 6 Network Interfaces on my 2950, 2 onboard the MB, and 2 – dual port add in cards…. I couldn’t justify spending over $200 on a 4port and went with 2 dual ports for $35/each :) I try to keep it simple with my configuration on Proxmox. Eth0 maps to vmbr0, eth1 maps to vmbr1, etc. That comes in real handy when you’re dealing with something like pfSense, then em0 maps to vmbr0, which maps to eth0… nice and easy! The only interface in Proxmox that has an IP is vmbr0, which I use for internal traffic, vmbr1 is external.

          • pocoO

            Thank you very much for the info…i see. If i understand correctly, if you want two interfaces in pfsense: the internal one goes to the “internal” virtual bridge (vmbr0 for example..eth0 in proxmox) and the external one to vmbr1..eth1 in proxmox. The rest of the vm can go into the same vmbr0. So, the bridges are only connected throw the firewall interfaces…isn’t it? thanks again…and sorry for too many questions ;)

          • http://www.facebook.com/profile.php?id=689444745 Alan McAlexander

            You’re right on. Now let’s say that you build a VLAN on em2 (the pfSense interface), which is connected to vmbr2 on Proxmox – and now you want to put a VM on that VLAN, just assign vmbr2 to that VM and you’re done. No worries on the questions. I was that way about a year ago, once it’s sorted out in your mind it makes sense.

          • pocoO

            I see it much clear now…ill try with the vlans too…thanks.

  • Pingback: Setup your personal Cloud server in minutes using ownCloud | Thelinuxgeek

  • Pingback: Setting up your ownCloud | 0ddn1x: tricks with *nix

  • andrew

    hello I have this error

    [root@cloud html]# /etc/init.d/httpd restart

    then this appears

    Starting httpd: httpd: Syntax error on line 350 of /etc/httpd/conf/httpd.conf: without matching section.

    plz tell how to fix this.

    • http://www.unixmen.com SK

      Andrew look into your httpd.conf file at line no 350. There might be a syntax error.

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

jacky can

|

You can actually unzip your secret archive by leaving out the -t option, instead using:

unzip newPhoto.jpg

DragonFartOutLoud

|

it went to china.

DragonFartOutLoud

|

great review! i’ve been using it as my main OS since Beta 1 release. its been a awesome ride so far :)

jet li

|

i try the method, and i unzip the image contain zip secret, i dont find the file that i was hide, where it go? and how to open it? :s

zinovsky

|

Yes, it is possible using Steganography, we will post another quick howto do that in the next few days

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .