Configure Own Cloud Server In RHEL...




Owncloud provides services similar to dropbox. Many of the other websites similar to dropbox that provide file storage, syncing, and sharing functions. The benefit of owncloud is to taking control of our own data and the file storage space.

Prerequisites: 

1- Set Static IP
2- Change Hostname
3- Disable Selinux
4- Install Package- httpd php php-mysql sqlite php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-gd curl php-curl
                              
 Step-1 Set Static IP

[root@server ashutosh]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

IPADDR=192.168.0.1
NETMASK=255.255.255.0

Step-2 Change Hostname

[root@server ashutosh]# vim /etc/sysconfig/network

HOSTNAME=server.ashu.com

[root@server ashutosh]# vim /etc/hosts

192.168.0.1      server.ashu.com         server

[root@server ashutosh]# hostname
 

server.ashu.com
 

Step-3 Disable Selinux

[root@server ashutosh]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
 



Step-4  Install Packages...


[root@server ashutosh]# httpd php php-mysql sqlite php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-gd curl php-curl



Step-5 Download ownCloud, Then Extract


[root@server ashutosh]# wget http://download.owncloud.org/community/owncloud-5.0.5.tar.bz2

[root@server ashutosh]# tar -jxvf owncloud-5.0.5.tar.bz2

Move ownCloud under Apache server document root.

[root@server ashutosh]# mkdir /var/www/cloud
 

[root@server ashutosh]# mv owncloud /var/www/cloud

Allow the web server to read and write the files on cloud directory.

[root@server ashutosh]# chown -R apache.apache /var/www/cloud/
[root@server ashutosh]# chmod 777 -R /var/www/cloud

Step-6 Create Database


Note- MySQL server must be started before creating the database, login to MySQL server.

[root@server ashutosh]# mysql -u root -p

-----------------------------------------------------------------------------------------------------------------------------
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 66
Server version: 5.5.34-MariaDB MariaDB Server
.
Copyright (c) 2000, 2013, Oracle, Monty Program 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.04 sec)
.
MariaDB [(none)]> GRANT ALL ON owncloud.* TO 'ownuser'@'localhost' IDENTIFIED BY 'ownpass';
Query OK, 0 rows affected (0.01 sec)
.
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.01 sec)
.
MariaDB [(none)]> exit;
Bye



-----------------------------------------------------------------------------------------------------------------------------

Step-7 Configure Apache Server...

Note- While configuring Apache web server, it is recommended that you to enable .htaccess to get a enhanced security features, by default .htaccess is disabled in Apache server. To enable it, open your virtual host file and make AllowOverride is set to All.For example, here i used external config file instead of modifying main file.

 [root@server ashutosh]# vi /etc/httpd/conf.d/cloud.conf
-----------------------------------------------------------------------------------------------------------------------------

Add the following.

<IfModule mod_alias.c>
Alias /cloud /var/www/cloud/
</IfModule>
<Directory “/var/www/cloud”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
:wq (Save & Quit)
-----------------------------------------------------------------------------------------------------------------------------

 Step-8 Now Restart httpd Service...


 [root@server ashutosh]# /etc/init.d/httpd rstart;chkconfig httpd on


 Step-9 Configure OwnCloud...

Open Web Browser and Type...URL 'http://192.168.0.1/cloud'

Then Browser open and Enter admin user name, password, data folder location and database details. You can choose  MySQL database.


where as MySQL database requires database user, password and data base name.


Now you can start upload a file via browser, alternately you can download ownCloud client to upload the files.


 OwnCloud Server Configuration Has Been Completed...
______________________________________________________________________________________
Click Back..                                Click Home..
https://docs.google.com/forms/d/1iNRZlJJO6rBFizzPcFmyOTEtfkdjhdVRmpM74IbiT3o/viewform