My server revisited: Preparing for easter :)

My old laptop turned into a trusty server

My old laptop turned into a trusty server

 

Easter is nearing, my master thesis deadline is nearing (June 1st), all sorts of things are nearing. I’ll be heading home for Easter to be with family and friends. But! Before doing so I wanted to make sure that I would still be able to access my server that is hosting my master thesis web-app. There were a couple of hurdles to overcome:

  1. Automatically check vpn connection every ten min. At the University we connect to internet usually through VPN so the server needed to automatically reconnect to the internet. I solved it by creating a cron job that reconnects to vpn every ten minutes.
  2. On system reboot reconnect to vpn and start noip2 process. The cron program has a very nifty option for running a script after reboot. With that I was able to instruct it to connect to vpn and also start noip which helps sort out my server’s ever changing ip and connect it to a stable domain name.

With these changes combined I should be able to fully work on the server without it being kicked of the network and me being able to reboot it. I did some tests and everything seems to be in order.

If you look closely you'll see a printout of my crontab set to run to scripts when their conditions occur.

If you look closely you’ll see a printout of my crontab set to run to scripts when their conditions occur.

Oh, how much work I’ll be able to get done during Easter… At least I won’t be tearing my hair out because I’m not around to restart my server. The weak point here is in the case of a power outage in which it won’t properly restart the processes. I could insert the laptop battery which could act as a nice buffer but it lowers the battery’s capacity and I’m not sure if I want to do that.

Anyhow. Learned some more sysadmin skills today which might always come in handy. ;)

Advertisements

Late night sysadmin’in: Repurposing my old laptop to serve up my master’s project

After having a great session of Friday Night Lightning with the gang from Pils & Programmering I was just going to drop by my dedicated study space at my University and drop of my laptop.

I ended up sticking around tinkering on an old laptop of mine setting it up to be a server while listening to a couple of interviews with Jeri Elsworth, an inspiring self-taught engineer.

A server is a computer which is typically connected to the internet and serves up files or is able to perform other tasks like resending e-mail, being a remote backup space amongst other useful tasks.

My new laptop is a hp g6-2131so, and it came with a 5400rpm 750gb hdd (quite slow but quiet). In my old laptop, a hp dv9510, I had a 80gb intel ssd hdd (much much faster than the hdd I received with my new laptop). So, I decided to switch the hdds and repurpose my old laptop into a server.

Time was around 22.00 – 00.30 while I did all of this tinkering. As a master student we have key card access to the faculty building and our own keys to our study spaces in which we have dedicated study spaces. I share a room with five other people. Technically, we can stay at school all night all the time. I really try not to, but this time I just wanted to wind off by setting up this server.

I ended up using Lubuntu 12.10 as the operating system, not the most stable perhaps and I might end up going for Crunchbang or straight up Debian instead. A challenge I had to overcome is that the server would have to automatically connect to the internet using vpn and automatically reconnect if ever it would get kicked off the network (which it will be). I tried my best to follow this guide, with some success but it ended up not working. Better luck next time. :)

Yet another challenge was that this server would never have a consistent ip-address. Luckily, a friend of mine recommended no-ip.com which is a service that provides a domain name for free that the server could talk to and make sure that the name would always point to the server’s ip-address. The result is me only having to remember one name instead of a shifting series of long numbers.

In the end I managed to get my server up and running serving up my web application. Tinkering joy! :) Having such a server at hand will be especially handy right now since I tried using a proper web host but it didn’t work out (I tried using something that was totally free).

Moving forward I hope to get the server properly auto-connecting to the internet, acting as a backup system and serving up various web applications. :) Puh. It’s gotten really, really late. But hey it’s been a fun day/evening/night. I’ll sleep for a long time tomorrow.