Consolidation of Web Hosting

Over the years I have registered many domain names and accumulated a number of web hosting accounts. Most of these sites were created for my own tinkering and receive very little traffic; even on the smallest hosting packages they don’t get anywhere near the limit for storage space or bandwidth.  Historically I have taken the easy option and just renewed the services but this year I decided to try and save some money by moving all my sites to one web hosting account.

… 

 

iRemember App Demo

For the final project of the Coursera course Programming Mobile Applications for Android Handheld Systems we had to develop our own version of an app, based on skeleton files provided to us.  The app was iRemember, which allows you to capture ‘life stories’ by recording audio and video and taking pictures, as well as saving the date and location of events.

Once the project was completed, we were asked to record a screencast of our working app.  You can see mine here. The video shows the app running on an emulated Galaxy Nexus running Android 4.3 (API Level 18), which is the API level we were asked to test on.

For people not involved in this course, the project required us to implement audio, video and photo recording as well as saving to and retrieving from a database. The layout was provided for us and is very basic. We were not asked to change this for the graded part of the project, although it was suggested that we could extend the project by improving the look and feel of the app. I intend to do this and will upload new new video/screenshots when done.

 

 

MOOCs

Over the past few months I have developed a real enthusiasm for MOOCs (Massive Open Online Courses).  The choice of courses can be quite overwhelming, although there are useful aggregator sites such as Class Central and MOOC List that can help you narrow down your search for the right subject.

I’ve signed up for a handful of these courses and have created a dedicated MOOC Courses page to keep track of what I’m studying.  At this stage I’m not sure if all the courses I have enrolled in will be suitable for my existing level of knowledge.  For example, some of the courses cover subjects I have already studied at university.  I’m hoping the courses I have selected will provide a combination of revision on new information. The great thing about them is that they are free to enrol in, so it’s easy to drop ones that turn out to be unsuitable.

 

Install Chromium OS on your Netbook

This post explains how to install Chromium OS on a netbook.  Chromium OS is the open source project upon which Google base the Chrome OS operating system.

More specifically, I installed the operating system on my HP Mini 210 and did all the preparation work on a PC and laptop running Ubuntu 12.04/13.04.  The installation will vary depending on the specific hardware used, so your installation process will most likely differ from mine in some ways.

… 

 

Computer Science at Harvard

At the beginning of this year, I enrolled in a Computer Science course run by Harvard University on edX.

This is a introduction course and it may seem strange to be taking this when I already have a Masters in this subject. The reason I decided to enrol was mainly as a refresher and to ensure I remembered all the fundamentals before moving onto more challenging stuff. I intend to take more advanced courses soon, or once I have completed this one, depending on how much free time I have.  I see the main benefits of doing this course as:

  • A refresher of C programming, which I have not used much since completing my Masters
  • The opportunity to learn more about web languages, such as Javascript and PHP
  • The chance to meet and study with a large number of other students (something like 13,000 people have signed up for the online course, although I believe the last time this course was run, only a small proportion of that number completed the whole course)

Depending on the content, I’ll post updates for some Problem Sets as I complete them, however I won’t be posting source code at this stage as other people on the course may not have finished them yet.

 

Home Web Server 2

As I am currently unable to run a web server due to my broadband connection and lack of suitable hardware, I thought I’d get started by setting up a virtual server. I’ve used VirtualBox for a number of years now, to install and test various Linux distributions and other operating systems.

1. Install Debian

I downloaded the 40MB “Smaller CD” Net Install ISO of Debian 6 from here. The Net Install means you start with a very small ISO file and then download only the packages you need for your installation.

For the virtual machine, I selected minimal specs: 256MB RAM and 8GB dynamically expanding hard drive. Installing Debian on VirtualBox is very straighforward and I won’t go into all the details here. The only thing worth noting is when you are asked what collections of software you want installed on top of your core system. I chose the following options:

tasksel

This, amongst other things, installs Apache HTTP Server, PostgreSQL and OpenSSH, just what we need for a web server. You can run tasksel after installation to bring up these options again and of course you can install individual packages as needed. When Debian boots, it starts these services automatically without need for further configuration.

2. Configure VirtualBox Networking

VirtualBox has a number of options for how the virtual network adapter attaches to the real network of the host operating system. The default is NAT, which means that the host and the virtual machine cannot see each other on the network. However, you can setup port forwarding so that certain ports on the host connect to ports on the virtual machine. I setup the following:

Port Forwarding

You can use any port numbers that are above 1024 and not in use for the Host Port. For the virtual machine, you need to use port 80 for HTTP (to connect to Apache) and port 22 for SSH. Whilst SSH is not strictly necessary for administering the virtual machine, it’s worth doing to more closely replicate a real server environment.

To check Apache is running and view the default homepage type the following into your host web browser:

localhost:9000

3. Setup SSH

To SSH to the new server type the following from the host command prompt:

ssh -p 9010 127.0.0.1

Now log out of the remote computer and back in the host command prompt generate a key by typing:

ssh-keygen -t dsa

You will now want to copy the key to the remote computers folder ~/.ssh/authorized_keys. If the .ssh folder does not already exit on the remote machine, you need to create it and give it the correct permission. On the remote computer type:

mkdir ~/.ssh
chmod 700 ~/.ssh

Note that, although you will be copying into authorized_keys, you do not need to create this folder, it will be generated for you.

Now, back on the host machine, copy the public key over to the remote machine with:

scp -P 9010 ~/.ssh/id_dsa.pub 127.0.0.1:.ssh/authorized_keys

Note that while the -p switch for ssh is lowercase, it is uppercase for scp.

Now, reconnect to the remote machine. This time you should be asked for the passphrase you used when you set up your key. Type it in and connect to the remote machine again.

Most modern linux distributions start the ssh-agent program on boot up, which means that once you’ve typed in your passphrase once, future connections will connect without asking for your password or passphrase. This was the case with my host machine, which runs Ubuntu. For further information about setting up SSH, see this site.

Finally, the default Document Root directory for web pages is in /var/www, so to copy your own index.html file type:

scp -P 9010 ~/broohn.org/index.html root@127.0.0.1:/var/www

Because of the default permissions, you need to connect as root to copy this file over. Now when you refresh your web browser you should see your own home page.

 

 

Home Web Server

It’s worth noting that I used Apache’s Tomcat server for this installation, which is primarily a container for Java Servlets and Java Server Pages (JSPs). Tomcat can be used as a stand-alone server (as I have done here), however if you are not going to be using Java on your website, you’ll probably want to use the Apache HTTPD server instead.

1. Install Debian

Perform a Net Install. Only select ‘Standard Install’ on tasksel.

2. Install Java (Only necessary if you intend to run Java Servlets/JSP)

First you need to edit /etc/apt/sources.list file. To open in vim (text editor):

Add the following lines:

Save and close, then from the command prompt run:

Check you have the latest version of java:

3. Install Tomcat

4. Configure Tomcat

Get Tomcat to start on boot-up by creating an init file:

Add the following to the init file:

Then run:

Change Permissions:

Open the tomcat-users.xml file:

Add the following:

Now restart Tomcat for changes to take affect:

You can start and stop Tomcat when you need to with:

In your web browser go to http://localhost:8080, you should see Tomcat’s default home page.

5. Set up a domain name and configure your router

I created a free subdomain with dyn.com.

Setting up your router will vary, however my router had an option to include details of my Dyndns account, so it would update itself when my dynamic IP address changed.

Tomcat runs on Port 8080 by default and whilst you can change this, it’s probably easier to modify your router settings to requests to Port 80 get forwarded to 8080. Portforward.com has instructions for how to set up port forwarding on a huge array of different routers.

6. Create your website

Start by putting your home page here:

Now, go somewhere that is not on your local network, open a browser and typehttp://yourdomainname.com. You should see your new website in all its splendour!