Cloud Computing

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Practical No1: In this practical you will see how to setup your owncloud server and how to secure

your
cloud from network eavesdropping like MITM attacks etc.

Requirements:

A Linux PC (In this tutorial iam using Kali Linux)

Good Internet Connection (Static IP would be preferable in case if you want to provide services to
outsiders)

Step1: Boot up your kali Linux and open a browser and download the owncloud file from the official
website. Download the zip file so that you can follow the next commands along with me.

Chinni Diwakar 1
After Downloading goto download location on your kali linux (/root/Downloads) and Extract the
owncloud archive files with the below given command

Chinni Diwakar 2
Chinni Diwakar 3
You can see the extracted files are there in owncloud directory.

Copy or move the files towards the webserver directory in the lab scenario it would be /var/www/html/

Copy the permission giving script from the official website and make it executable and execute that file
to do some operations which are required.

The file contents are provided below you can copy paste to do the job.

#!/bin/bash
ocpath='/var/www/html/owncloud'
htuser='www-data'
htgroup='www-data'
rootuser='root'

printf "Creating possible missing Directories\n"


mkdir -p $ocpath/data
mkdir -p $ocpath/assets

printf "chmod Files and Directories\n"


find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750

printf "chown Directories\n"


chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/

Chinni Diwakar 4
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"


if [ -f ${ocpath}/.htaccess ]
then
chmod 0644 ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocpath}/data/.htaccess ]
then
chmod 0644 ${ocpath}/data/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
fi
Change the default web server directory to your webserver directory in the above given script, in this
scenario it would be

From /var/www/owncloud/ -> /var/www/html/owncloud.

Make some changes similar to this in your file and execute.

Install the following packages so that the owncloud will work without any problems.

Execute and given commands to fulfill the dependencies.

apt-get update

Chinni Diwakar 5
apt-get install php5-curl php5-gd –y

Then restart your apache2 and MySQL servers to get started, execute the below commands to restart
them.

service apache2 restart

Or

service apache2 reload

service mysql restart

Now go to your favorite browser to open 127.0.0.1/owncloud

Chinni Diwakar 6
You could see your own cloud server is prompting for the first time setup. Go on and proceed with the
initial setup. If you don’t know what to configure follow the given details

Username: yourchoice

Password: yourchoice

Database location: will be there already don’t change

Database username: root (most probably)

Database password: leave empty (there is not default password)

Database location : can be either 127.0.0.1 or localhost

Chinni Diwakar 7
Then click register button to complete the installation process.

Chinni Diwakar 8
Now your cloud is ready to go

Then go to owncloud config file in your pc (/var/www/html/owncloud/config/config.php in my pc)

And add your ip address in trusted domains category.

Chinni Diwakar 9
If it is local host you can only access it change that localhost into your ip so everyone can access.

Then save the file and restart the servers again

Now users can access your cloud from browsers.

Chinni Diwakar 10
Practical No 2: Enabling SSL to prevent network eavesdropping like MITM attacks.

First check your website can be opened through https or not by trying
https://yourwebserveraddress/owncloud

Ex: https://localhost/owncloud

If it is working with https you can stop proceeding if not

Open a terminal in your owncloud installed pc and execute the following commands

a2enmod ssl

a2ensite default-ssl

service apache2 reload

service mysql restart

Then test your website with

https://localhost/owncloud you can see it will open in https

Now your cloud is secured

You can see the above practicals in the following video

You can goto youtube.com/thecybercare to watch it.

Chinni Diwakar 11

You might also like