For those who are not familiar with Odroid XU4 and CloudShell, Odroid XU4 is an ARM-based Octa core single board computer based on the Samsung Exynos5422 2Ghz Cortex A15 and Cortex A7 cores with 2 Gbytes of memory. CloudShell is a compact case for Odroid XU4 with a 2.2 inch TFT LCD and a USB 3 to SATA bridge for connection to a 2.5 inch SATA hard disk. The assembled CloudShell is shown in the diagram below.
The ARM big.LITTLE technology is ideal for a home server in that when the cpu load is low, it uses the power efficient A7 core(s) and when the load is high, it switches to use the high performance A15 core(s). It may use 1 core, more than 1 core or all cores at the same time depending on the load. This means energy saving in the long run.
This article is not an Odroid XU4 review. For that you can read this in-depth review here. This article describes my experience in using this wonderful little device.
When people talk about home servers, they usually mean Kodi as a home theatre server. For that I can use a smart TV and a set-top box. My home server requirements are quite specific. The following sections describes how I use the Odroid XU4 as a home server along with links to useful information regarding the setup procedure and the finer points of installation and usage. I hope this will help those who are planning to set up CloudShell for similar objectives to mine.
Assembling the CloudShell
Assembling the CloudShell is not difficult. However, if you are new to Linux, you will probably be wondering where your hard disk is once you boot up the machine as the disk does not show up when you issue the “df” command. For it to appear, you have to partition it and enter an entry in the /etc/fstab file for the disk to show up by issuing a “mountall” command or rebooting the machine. You should test out if you have any error in your new fstab entries using “mountall”. If there is an error in the entry and you do not know about it, the machine will not boot up after shutdown. You will have to take out the SD card, insert it into your Linux machine, mount it and correct the fstab file before you will be able to boot up your Odroid again, Here are some useful links to help you set up your CloudShell.
- The physical assembly is straight forward, just follow the pictorial procedure here
- Information on how to set up the LCD and IR receiver can be found by going to the Odroid Wiki and do a search on “CloudShell”
- Hard Disk setup procedure can be found here
- You may also want to set up a swap partition. Note that the UUID for the swap partition needed for /etc/fstab is not generated until you issue the “mkswap” command.
Networking and Dynamic DNS
Before you expose your home server to the Internet, you should make sure the proper security is in place. Here is my article on how I set up my home network security using a DMZ.
If, like me, your ISP provides you with a dynamic IP address, you need to set up Dynamic DNS such that you can refer to your server using the same domain name despite the IP address changing regularly. To do this, you need to:
- Sign up for a free Dynamic IP address account here. Of course you can use some other providers instead.
- Configure you Internet-facing router to use your DDNS. You will need the user name, password, host name (domain name you have chosen) when you registered with the provider in the previous step using your home router’s administration tool.
The following is how a DDNS setup screen might look like on a TP-LINK router looks like:
WordPress Server for Blogging
Setting up WordPress is not trivial. You have to set up the LAMP stack, create a database in MySQL and configure the Apache Web Server and WordPress including setting the proper ownership of files and directories. There are times when I say to myself: it may be easier if I use OpenShift Online, which is free, to run WordPress. Have patience and you will reap the rewards of running your own blog on your home server. Here are some hints to help you along.
- Install the LAMP stack
- Install WordPress. This is quite different from installing other packages. You cannot use the installed package in place after doing “apt-get install”. You have to copy all that content to your Apache Web Server document root as described in the link.
- If clicking on the “Add Media” button does not show any dialog box, add “define(‘CONCATENATE_SCRIPTS’, false );” to the bottom of your wp-config.php file.
- Replace all symbolic link under the /yourPath/www/html direcotry and sub-directories with a copy of the file it points to
- if you get message when accessing wordpress that you don’t have access to certain directory, it is most likely caused by /path/www/html/.htaccess. Remove it and see if it helps.
- “+FollowSymLinks” and “AllowOverride All” in /etc/apache2/sites-available/default.conf are important if you customise the WordPress permalinks which requires URL rewriting. Make sure you issue the commands: “sudo a2ensite default.conf” and “sudo service apache2 restart” after making changes to the default.conf file.
... ServerAdmin webmaster@localhost DocumentRoot /yourpath/www/html <Directory /yourpath/www/> Options -Indexes +FollowSymLinks AllowOverride All Require all granted </Directory> ...
- Configure your Internet-facing router to do port forwarding of port 80 to your CloudShell IP address and port 80
You are now reading this article on my home server so you know how my blog looks like.
NFS Server and Head Node for my Home Compute Cluster
I built a Home Compute Cluster using 4 Odroid U3 development boards as compute nodes some time ago. It is now time for a revamp. I am adding the CloudShell as the head node of the cluster and use the CloudShell as the NFS server so that when I want to run a parallel program on the cluster, I do not have to copy that program to each of the compute nodes. Using a NFS server, all I need to do is copy the program on the server and the compute nodes can access it. No more copying. I shall write an article on my Home Compute Cluster shortly.
I own a large variety of single board computers including Raspberry Pi, Beaglebone original, Beaglebone Black, Cubieboard V1. Odroid XU3 Lite, Odroid U3 and some of them do not have nfs module included in the kernel for use as a nfs server. I am pleasantly surprised that the Odroid XU4 has no such problems.
This is a good article on setting up nfs server and client: NFSv4Howto.
SSH Server for Remote Access
One can set up a VPN (Virtual Private Network) server to access you home network safely. For me, setting up a VPN is an overkill although I shall play around with it for fun when I have time. All I need is be able to access my CloudShell from the Internet using SSH. Once I can access my CloudShell from the Internet, I can use SSH port forwarding to create an encrypted tunnel to access my CloudShell’s desktop using VNC. I shall create a short post on this shortly.
- Configure your Internet-facing router to do port forwarding of a port number of your choosing to your CloudShell IP address and port 22. When you ssh to the CloudShell from the Internet, you use the port number that you have chosen instead of the default port 22 as a added security measure
- set up public key authentication on your CloudShell and machines to be using remote SSH login from the Internet. Then force ssh loigin via public key authentication only meaning that you are not going to be prompted for a password. It just terminates your session if you do not have the right public key.
Rule Engine Demo
I am a middleware solution architect by profession. So, it should not come as a surprise to you that I experiment and build small applications for demo purposes. One application I built and you can interact with it by using web services via SoapUI is described here.
This application requires installing the JBoss BPM Suite (BPMS) on the CloudShell. BPMS is an enterprise grade business process automation tool running on the well-known JBoss Enterprise Application Platform, a Java Enterprise Edition 6 (JEE 6) certified application server. It requires Java. Unlike the Odroid XU3 Lite and Odroid U3, Java is not installed on the OS that comes with the SD card. I download OpenJDK 1.8 using apt-get install. I had problems installing JBoss BPMS using the BPMS Java Installer. Most of the time, it fails to install complaining about missing Java classes and occasionally it finished installation but it will not start the installed application. After many tries, I decided to try out the Oracle JDK 1.8 for ARM. There is no problem either installing BPMS or running it using the Oracle JDK. This comes as a surprise to me because I used OpenJDK at work running BPMS on Fedora and Red Hat Enterprise Linux without any issues. It is rock-solid on the Intel platform. My Odroid U3-based Compute Cluster has been running Java 1.8 without any issues. Interesting enough, when I examine which version of Java has been installed on the U3, I found that both openJDK 1.7 and Oracle JDK 1.8 have been installed on it but the latter is the default version meaning that I have been using Oracle JDK 1.8 on my U3 machines!
- Configure your Internet-facing router to do port forwarding of port 8080 to your CloudShell IP address and port 8080
- when starting your JBoss BPMS using the standalone.sh script, be sure to add the option parameter -b ipaddressOfYourCloudShell (eg, ./standalone.sh -b 188.8.131.52) as by default standalone.sh binds only to localhost or loopback address.
The Odroid XU4 CloudShell is a powerful little device that just appears to be tailor-made for use as a home server. With all the above applications running on it including the enterprise grade JBoss BPMS running on the JBoss EAP application server, I just can’t help being amazed by how well it is handling the load. The fan on the Odroid XU4 seldom comes on. But when it comes on, it is LOUD! I think this is the only thing I don’t like about this device.