Sync and Share Solution on Alibaba Cloud

  1. Ever expanding need for storage
  2. Lack of (or limited) authentication and fine grained authorization capabilities
  3. Version control
  4. The need for VPN or other secure connectivity in order to access documentation from outside the enterprise network (for mobile / satellite users)
  5. Limited to no support for mobile devices

Application Layout

As stated above for the purpose of this exercise I decided to deploy the open-source application known as OwnCloud. OwnCloud provides very similar functionality to the likes of services like Dropbox or OneDrive, which allow users to backup their files and sync them across multiple devices. With OwnCloud, we will setup our own Dropbox like service and also be able to provide some functionality in addition to what we get from the typical public services.

  1. Allow Internet Ingress TCP 80,443 on ECS-Instance 1 (Deny everything else)
  2. Deny All Internet Ingress on ECS-Instance 2

Test Application Deployment

The test application deployment is a simple process. Use the following steps in order to deploy OwnCloud on Alibaba Cloud.

Setting up the Database

In order deploy OwnCloud the first step is to setup MySQL database. I have followed the following steps to configure the OwnCloud database on the ApsaraDB for RDS instance.

  1. Database name: owncloud
  2. Support character set: utf8
  1. Database Account: owncloud
  2. Authorized Database: Move owncloud to Authorized database and make sure that Read/Write is checked
  3. Password:
  4. Confirm password:

Deploying the OwnCloud Application

Installation

The second step in setting up OwnCloud is installing the application itself. I followed the following steps to deploy the OwnCloud on ECS instance 1:

$ ssh root@xx.xx.xx.xx
$ cd /tmp 
$ wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key
$ sudo apt-key add - < Release.key
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list"
sudo apt-get update
sudo apt-get install owncloud

Configuration

Once the application is installed, we can proceed to the initial setup. Before the initial configuration make sure that you have connectivity to the owncloud database from the ECS-Instance 1.

$ mysql -h <Database-URL> -P 3306 -u owncloud -p
mysql> use owncloud;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> exit
Bye

Using the OwnCloud Application

Once completed, you are presented with the OwnCloud dashboard:

Creating a New User

In order to create a new user use the following steps:

Installing the OwnCloud Desktop Client

Follow the following procedure to deploy the agent on a Linux desktop.

$ sudo dnf config-manager --add-repo http://download.opensuse.org/repositories/isv:ownCloud:desktop/Fedora_25/isv:ownCloud:desktop.repo
$ sudo dnf install owncloud-client

Adding External Storage to OwnCloud

In its current configuration the OwnCloud is putting all the user files in /var/www/owncloud/data folder on the ECS-Instance 1.

$ sudo adduser owncloud
$ sudo su - owncloud
$ mkdir /home/owncloud/owncloudstorage
$ mkdir /home/owncloud/oadmin
$ mkdir /home/owncloud/appuser
$ mkdir /home/owncloud/owncloudstorage
  1. Host: 10.27.48.132
  2. Username: owncloud
  3. Password:
  4. Remote subfolder: /home/owncloud/owncloudstorage
  1. Host: 10.27.48.132
  2. Username: owncloud
  3. Password:
  4. Remote subfolder: /home/owncloud/appuser
  5. Available for: appuser
  1. Host: 10.27.48.132
  2. Username: owncloud
  3. Password:
  4. Remote subfolder: /home/owncloud/oadmin
  5. Available for oadmin

Considerations

There are a few things that need to be kept in to consideration when deploying the app on the cloud:

  1. Make sure that both your ECS instance and the RDS instance are in the same Region / Zone. If not then the only way to communicate with the RDS will be by obtaining an internet facing IP for the RDS instance. This is unnecessary as we do not need to expose the Database to the internet for this application, and will also incur more costs besides being a security concern.
  2. Ensure that when you mount the External Storage you are using the intranet IP. While file transfer will work using the internet IP as well there is no need for putting the external storage traffic on the internet.
  3. Make sure when you are adding OwnCloud repositories you add them for the correct operating system version.
  4. During the installation (not configuration) of OwnCloud application it requests for a mysql admin username and password. However we are not using this configuration as our database is not sitting locally.
  1. Mount a cloud storage to the ECS1-Instance under the Storage folder to store user files.
  2. Obtain a domain name for the Application server URL and bind it to the Internet IP for the ECS — Instance 1.
  3. Obtain a SSL certificate and run the application on https.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

4.97K Followers

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com