Monday, September 14, 2015

Step 1: Install ownCloud Storage in Linux

In order to setup your own personal cloud storage (ownCloud), you must have LAMP (LinuxApache,MySQLPHP) stack installed. Other than LAMP stack you might need Perl and Python based upon your use.
On Debian/Ubuntu/Linux Mint
# apt-get install apache2 apache2-doc apache2-utils mysql-server mysql-client php5 php5-mysql php5-curl
On RedHat/CentOS/Fedora
# yum install httpd mysql-server mysql-client php php-mysql php-curl

Step 2: Create Cloud Database

Once you setup LAMP stack on your personal box, just login to your database (MySQL, here).
# mysql -u root -p
Enter mysql root password. Now we will be creating a database (say cloud).
mysql> create database cloud ; 
Query OK, 1 row affected (0.00 sec)
It is not a good idea to access your database from root, hence grant all the permission to a normal user (say tecmint).
mysql> grant all on cloud.* to tecmint@localhost identified by 'my_password'; 
Query OK, 0 rows affected (0.00 sec)

Step 3: Download and Install ownCloud Application

Now its time to Download latest ownCloud (i.e version 8.0.0) application using below link.
  1. http://owncloud.org/install/
Alternatively, you may use wget command to download the source tar-ball package.
# wget https://download.owncloud.org/community/owncloud-8.0.0.tar.bz2
You may alternatively install from source package using APT or YUM. The installation instruction can be found at:
  1. Install ownCloud using APT or YUM
However we choose the TAR package which is universally accepted and works on most of the known system.
After Downloading the owncloud package, move it to your Apache working directory, which is /var/www(for Debian) and /var/www/html (for RedHat).
# cp owncloud-8.0.0.tar.bz2 /var/www/  [For Debian based Systems]
# cp owncloud-8.0.0.tar.bz2 /var/www/html/ [For RedHat based Systems]
Next, extract the package using tar command as shown below.
# tar -jxvf owncloud-8.0.0.tar.bz2
Since the TAR Archive is extracted you may remove the Archive.
# rm -rf owncloud-8.0.0.tar.bz2
We might need to change the file permission of owncloud, in our Apache working directory.
# chmod -R 777 owncloud/
Note: Remember we are giving readwrite and execute permission to all, which is although risky but this time needed since several configuration file would be written automatically. We later need to change permission to 755, once the setup is finished.

Step 4: Configuring Apache for ownCloud

For security purpose ownCloud uses Apache‘s .htaccess files, in order to use them. We need to enable two Apache modules mod_rewrite and mod_headers for ownCloud to function properly. Type the following command to enable these modules under Debian based systems only, for RedHat systems they are enabled by default.
# a2enmod rewrite
# a2enmod headers
Additionally, we need to enable mod_rewrite rules to work properly under Apache‘s main configuration file. Open the Apache global configuation file.
# nano /etc/apache2/sites-available/default [For Debian based Systems]
# vi /etc/httpd/conf/httpd.conf   [For RedHat based Systems]
There, find “AllowOverride None” and change this to “AllowOverride All” as shown.
AllowOverride None
Change this to:
AllowOverride All
Now we need to restart Apache to reload new changes.
# service apache2 restart   [For Debian based Systems]
# service httpd restart    [For RedHat based Systems]

Step 5: Access ownCloud Application

Now you can acess your very personal cloud storage at:
http://localhost/owncloud
OR
http://your-ip-address/owncloud
Once you get the Owncloud page, you need to create an admin account and a Data folder location, where all files/folders will be stored (or leave default location i.e. /var/www/owncloud/data or/var/www/html/owncloud/data). Next, you need to enter mysql database usernamepassword anddatabase name, refer the screenshot below.
ownCloud Configuration
ownCloud Configuration
Once all the correct values are entered, click Finish and your private cloud storage is ready, you are greeted with the working interface:
OwnCloud Admin Panel
OwnCloud Admin Panel
Notice the Favorites, edit, share, download, upload and new file options available for a file.
OwnCloud Upload
OwnCloud Upload
Activities log of oneself and others.
Owncloud Activity Log

No comments:

Post a Comment

Linux Tables: Block All Incoming Traffic But Allow SSH

  This is very common scenario. You want to permit access to a remote machine only by SSH. You would like to block all incoming traffic to y...