Ubuntu - Setting up Wuala


This tutorial will demonstrate how to setup an NFS share using your Cloud Server and the Wuala online backup service. This service available to users with 1GB of storage space for free. Additional storage may be purchased as you need it.

This tutorial assumes the following items:

  • You are running Ubuntu with the latest updates installed.
  • You have access to the root user account and can login with it.

This tutorial was created using Ubuntu 9.10 (Karmic). You may use other versions of Ubuntu but your results may be different. Please note that the Wuala service is Java-based and requires a significant amount of system memory to operate. Please do not attempt to run this without 512MB of system memory or you may risk data loss or NFS-sync issues.

 

Contents

What is Wuala?

Wuala is an online expandable file storage service that allows you to access your files anywhere. Wuala offers you multiple method to access your files including NFS mounting and web-based. All data is encrypted when it is stored so you have no worries about it being read by others - not even by Wuala staff. Wuala gives you the ability to share your files with family and friends with publicly accessible URLs.

Setting up your Wuala account

Before you begin this tutorial you need to setup your Wuala account. To create your account go to their website, http://www.wuala.com/ and click the red Start button. You will need to download the client to create your account. Once you have the client installed and your account setup you may upload files or delete the client as we will not need it for the remainder of this tutorial. Unfortunately there is not a way to setup your account without downloading the client.

At this point you should be connected to your Cloud Server as the root user. Be sure that you have performed all of your system updates and secured your server appropriately.

 

Installing Java

Installing Java on your Cloud Server is a fairly straight-forward process. The first thing we will need to do is to locate the file that we need to download. Point your web browser to http://www.java.com/en/download/manual.jsp to locate your installer file. Scroll down to Linux and locate Linux x64. Copy the download location (right-click the link and select Copy Link usually) and go back to your Cloud Server.

Now that you have the appropriate download URL we need to setup our location to download the file. The download will be placed in /usr/java but right now that doesn't exist. To create the directory run the following command:

$ mkdir /usr/java

Once you have that created we will need to move to that directory...

$ cd /usr/java

Now that we are in the correct directory we are ready to download our Java installer. We will supply the URL that was available at the time of writing, yours may vary slightly. Type the following command to download the installer:

$ wget -O java_installer.bin http://javadl.sun.com/webapps/download/AutoDL?BundleId=35679

You'll notice that we specified the output file name as java_installer.bin. This is important because if you do not then you will get a long unreadable file name.

Now we need to make the installer executable so we can actually install it. Type the following command:

$ chmod +x java_installer.bin

The file should now be executable... simply start the installation by typing the following:

$ ./java_installer.bin

You will be presented with the Sun license agreement -- press the Space Bar to cycle through the agreement. At the end you will be prompted if you agree, type yes and press Enter. If all goes well you will see several files extracted and will be returned back to the prompt. If you perform a directory listing (ls -la) you will see something that looks like the following:

total 19836
drwxr-xr-x  3 root root     4096 Jan 12 05:34 .
drwxr-xr-x 11 root root     4096 Jan 12 05:32 ..
-rwxr-xr-x  1 root root 20272901 Oct 19 13:56 java_installer.bin
drwxr-xr-x  8 root root     4096 Jan 12 05:34 jre1.6.0_17

You may delete the installer by typing the following:

$ rm java_installer.bin

Now we need to setup our Java environment variables so other applications know we have Java installed. To do this we will modify the $JAVA environment variable by way of the /etc/profile file so it is applied to every user. Please note that your path may be slightly different from the one we are using. To modify the file type the following to append it:

$ echo "export JAVA=/usr/java/jre1.6.0_17/bin/java" >> /etc/profile

You can test the output by typing tail /etc/profile to see if it worked. You should see something similar to this:

umask 022
export JAVA=/usr/java/jre1.6.0_17/bin/java

For good measure we'll go ahead and restart the server. Do this by typing the following:

$ reboot

Once the server is back online connect as the root user again.

Installing the Wuala Agent

Before we are ready to download the Wuala Agent we need to make sure we are in the right location. Type the following:

$ cd /usr/local

Now that we are in the right location we are ready to download. The Wuala Agent has a static download URL so you do not need to look it up. Type the following below to download the agent:

$ wget http://www.wuala.com/files/wuala.tar.gz

Next we need to unpack the files...

$ tar zxvf wuala.tar.gz

In good practice, let's clean up our initial download to keep the server clean:

$ rm wuala.tar.gz

You should have a directory on your server (/usr/local/wuala) that holds your Wuala Agent installation. At this point we need to make sure it has the proper permissions. Type the following to make sure permissions are properly set:

$ chmod -R 755 /usr/local/wuala

Once you have this finished the installation is complete.

Initialization Script

To ease our integration with Wuala we will use a boot-up script to create our link with Wuala so we do not have to manually setup the connection each time. To create the startup script type the following:

$ nano /etc/init.d/wuala

This will bring up the nano text editor. If you'd like to use an alternative editor you are more than welcomed to. Paste in the following script:

#!/bin/sh
#/etc/init.d/wuala

# Variables
WUALA_USER="your_username"
WUALA_PASS="your_password"
WUALA_PATH="/usr/local/wuala"

# Define LSB log_* functions.
. /lib/lsb/init-functions

# Lock
touch /var/lock/wuala

case "$1" in
        start)
                log_daemon_msg "Starting Wuala Agent..."

                su - root -c "$WUALA_PATH/wuala -basepath $WUALA_PATH login $WUALA_USER $WUALA_PASS &" &
                sleep 5
                log_end_msg 0
                ;;
        stop)
                log_daemon_msg "Stopping Wuala Agent..."
                su - root -c "$WUALA_PATH/wuala -basepath $WUALA_PATH logout &" &
                log_end_msg 0
                ;;
        *)
                echo "Usage: /etc/init.d/wuala {start|stop}"

                exit 1
                ;;
esac

exit 0

Before you exit the editor you will need to change two items in this script. Change the WUALA_USER and WUALA_PASS variables in this script with your Wuala user name and password. Keep in mind that these will be stored in clear text and will be visible! If this is a concern please choose a password ONLY for Wuala or discontinue this tutorial. To save the file simply press CTRL-X followed by Y and then pressing Enter.

We need to make sure that the script is executable:

$ chmod +x /etc/init.d/wuala

Finally we need to tell Linux to execute the script during boot-up. Type the following to enable:

$ update-rc.d wuala defaults

Testing the Wuala Agent

Before we go too much farther let's test the Agent to make sure it's working. First we will need to reboot the server to actually start the agent. In our experience simply starting the service has caused problems with how the client loads. To restart the server type the following:

$ reboot

Once the server has rebooted type the following to test your session:

$ /usr/local/wuala/wuala -basepath /usr/local/wuala showStatus

Note that the base path MUST be included. Be sure to capitalize Status as well.

You should receive a response back similar to the following:

Running on console
Wuala Loader 2009-08-10
Arguments: -installed -nogui -basepath /usr/local/wuala showStatus 
Your status: Online

If you do not receive this, you may not be running the service or something went horribly wrong.

Next we will test a directory listing to make sure we can properly access our files. Type the following command to get a listing of the 'My Files' directory:

$ /usr/local/wuala/wuala -basepath /usr/local/wuala list myfiles

You should receive a response similar to the following:

Running on console
Wuala Loader 2009-08-10
Arguments: -installed -nogui -basepath /usr/local/wuala list myfiles 
Listing file in /wuala_user
Documents
Music
Photos
store
Tutorial
Videos
Favorites

If you receive a message that reads Problem: Please log in to see this element. then you did not properly fill in the login credentials in /etc/init.d/wuala.

If you've gotten this far then you're almost done!

Creating our NFS mount

Now is the fun part! We need to setup an NFS mount so that we can access our Wuala storage drive as if it were locally attached. Wuala has a built-in NFS server as part of the client software. Through the use of portmap it is able to announce itself as /wuala available to localhost. We are simply going to modify /etc/fstab to mount this partition as a logical directory. However, before we do this we need to install a few things.

To install the pre-requisites for NFS please run the following command:

$ apt-get install portmap nfs-common

Once you have the pre-requisites installed we can begin modifying our fstab files. First we will create a backup:

$ cp /etc/fstab /etc/fstab.backup

In the event of catastrophic failure you will be able to boot your server into rescue mode and revert your /etc/fstab file.

To setup the mount we will use a simple one-line command to modify /etc/fstab. The line has been split-up on the screen to make it easier to read.

$ echo "localhost:/wuala /usr/local/wuala/direct nfs defaults,users,noauto,rsize=8192,
       wsize=8192,timeo=60,acregmin=10,noac,intr,nolock,soft" >> /etc/fstab

Once again, please note that this goes on one line! You may look at your work by typing tail /etc/fstab. You'll notice that we are mounting this to /usr/local/wuala/direct... you may change the mount point but that is considered outside the scope of this tutorial.

To make our changes take effect and initialize everything in the proper order we will reboot the server. Type the following to reboot:

$ reboot

Once your server is back online please connect as root.

Testing your NFS mount

Once the server is online we will be able to test our NFS mount. Change to our newly mounted NFS location:

$ cd /usr/local/wuala/direct

Type ls to get a directory listing... you should get something like this:

myfiles  myfriends  mygroups

To briefly explain their structure... all of your files will be placed in myfiles. The myfriends and mygroups are internal directories used for permissions and the software client.

Let's traverse into your file storage directory:

$ cd myfiles

If you perform a directory listing (ls -la) you'll see the following:

total 9
dr-xr-xr-x 1 root root 512 Jan  9 18:40 .
drwxrwxrwx 1 root root 512 Nov 30  1979 ..
drwxrwxrwx 1 root root 512 Jan  9 18:40 Documents
drwxrwxrwx 1 root root 512 Jan  9 18:40 Favorites
drwxrwxrwx 1 root root 512 Jan  9 18:40 Music
drwxrwxrwx 1 root root 512 Jan  9 18:40 Photos
drwxrwxrwx 1 root root 512 Jan  9 18:40 Tutorial
drwxrwxrwx 1 root root 512 Jan  9 18:40 Videos
drwxrwxrwx 1 root root 512 Jan 12 05:06 store

You'll notice all of the files are owned by root -- this is okay. You'll also notice that every directory is 777 -- this is typical for NFS because these are logical directories and do not have permissions attached. You can create a test file in the Documents directory if you'd like. All files are viewable by all users.

Disclaimer

Rackspace is not affiliated with Wuala in any way. Rackspace is not responsible for any potential data loss that may result while using the Wuala service. All support requests for Wuala should be directed to their support department. The Rackspace Cloud will not offer support for Wuala-related issues. Your use of the Wuala service is at your own risk.

--Kelly Koehn 00:14, 12 January 2010 (CST)



Was this content helpful?




© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER