Building a 1U Server, Part 3

Posted by John
on Monday, 17 March 2008

server

System Config

While the final bits arrive for my new server project I might as well put pen to paper on how the server's O/S will be laid out.

The operating system I'm rooting for this time around will be Linux, purely for the flexibility and the stability; the hardware I'll have to run thru it's paces with a CPU testing tool to make sure i've not got a faulty chip along with some brute-force testing on the memory chips, it's going in co-location so I might as well do it as I don't want to drive down to the site everytime it falls over.

I'll be using SSH obviously to connect to it along with a strong keychain to make my logging in easier and the connection encrypted.

I've got a strong iptables config so will put that into play with a custom port for SSH, not the usual port 22 which is standard; the more things you put in the way of potential hackers the better.

And no, I won't be logging in as root, only if I absolutely have to.

System Layout

This is the tricky bit, working out how you're going to lay the system out and run the various services; there really isn't any good answer, no one solution will fit everything.

For me I've decided to use XEN virtualisation to segregate my services out so each one remains separate, not all my eggs in one basket.

So I plan to use XEN and ArchLinux to handle each server stack, e.g.

  • Database Server (MySQL / PostGreSql / Sqlite)
  • PHP Server (Lighttpd + PHP5)
  • Rails Server (Nginx, Thin, Ruby on Rails 2.0)
  • Caching Server (Memcache, or some kind of custom Content Delivery Network)

I haven't nailed down the particular distro of Linux for the core o/s but will be using ArchLinux to handle the 'baby' boxes, the controlling 'big-daddy' may either be Fedora or again ArchLinux.

Now this may sound like overkill, but it does make sense, as it'll allows me to custom-build each Server based on it's proposed use and with ArchLinux I can make sure no extra baggage is added with unneccesary features and services; tuning it to the maximum performance.

It also allows me to do image backups in the future of each server so I can take snapshots of each one, in case I need to restore any at a certain point in time (say a bad update).

ArchLinux?

I've grown to enjoy ArchLinux, mainly for it's neatness and light feature stack, but also because it has no set release number. Unlike other distro's there is no frozen release 7 or 8, you go with the latest core files and that's what you've got; taking the pressure out of always being on-top.

Also the package manager is a little more powerful and because you only install what you need you don't end up with tons of extra software you never even use. Rolling in at a 160mb ISO build compared to 4.4GB for your average Ubuntu or Fedora you know you're only getting the bare-bones.

As Judd Vinet, the founder of the Arch Linux project said: "It (Arch Linux) is what you make it."

Don't get me wrong, I'm not trying to bash any of the other distro's but as you can imagine with this particular project I have to keep things lean so I can maximise power and alleviate future problems when trying to identify awol services.

Final Notes

It's going to be a lot of work and probably a pain in the rear to put together but I've done this long enough with SliceHost and Virtual Hosting so I think I've cut my teeth long enough to do this for real.

Keep you posted how the build goes.

Storing My Life Online

Posted by John
on Wednesday, 03 October 2007

So here I am at work, I’ve forgotten my Ipod again (or just haven’t charged it); and I’m sitting here unhappy that I can’t listen to that Foo Fighters track once more.

I’m sure a lot of people have been in this situation, you’ve got a work machine and a home machine and all your stuff is available but only at home and you’re really kicking yourself for not being able to access that data in your lunchbreak. Come on, this is the 21st century and all.

Strongspace

At the beginning of this year Joyent were running one of their deals ‘The Mixed Grill’ plan, that basically offered you a 30GB Shared Server and 25GB secure online storage with StrongSpace for a one-off fee of $499. Well it was the beginning of the month and me being a geek I opted for it thinking it’d take the pain out of monthly fees, also I’m a fan of StrongSpace.

Thankfully this has paid off big time, you cannot imagine how much of a bonus having a development server permanently available to test things out on is; it’s helped me build some FaceBook Apps , practice my PHP code and learn a lot more about Apache.

On top of that the bonus of having 25GB of storage for the lifetime of StrongSpace is such a big bonus, I’ve managed to upload all my important stuff from my personal laptop; development code, etc, up to the service and so far it’s been excellent. I still backup occasionally to DVD but the weight off your mind is titanic!

Music

So with my important stuff on StrongSpace, what do I do about my music ?

Well I’ve looked at a couple of options, Amazon S3 + EC2 may be a choice for future web app hosting. But the one which stands out the most and gives me the ability to stream music from my online account is MediaMax .

You get 25GB upload storage with the free account with a download limit per month of 1GB, sounds good enough for streaming.

With my iTunes collection rolling in at 12GB, 25GB sounds fine so I’ll start uploading that as soon as I can.

My calculations have the total upload of 8,000,000kb with 45kb per second => will take 46 hours to upload so this might take some time. But if I stagger things and just leave stuff on for the initial upload it should take that extra burden off my mind.

Oh no! Legal Blackwater!

However, herein lies a problem; In Japan recently a court ruled that it was illegal to store music files online, also looking more closely at MediaMax and it seems that they’re in a little bit of internal turmoil as they’re switching the technology over to handle new users, so ftp’ing your files has been taken off; real shame.

I don’t know quite how to handle this, do I put my music online in the hope I can access it and that the service doesn’t cut out; and more importantly I don’t get sued?

I dunno, I like Amazon’s policy with regards to the S3 system (they don’t want to know what you store, just how much you use).

All a pretty gray area with regards to online copyrighted music.

So unfortunately till then I think I’ll have to stave off the uploading.

Real shame for the mp3 side, but top dog with my important work.

Exam Prep

Posted by John
on Tuesday, 25 September 2007

At the beginning of the year I decided to solidify my PHP skills with sitting the Zend PHP 5 exam. However soon after, work took over and so this was put back.

I did do all the revision but never got the time to book the day off for the exam, shame really.

However things have changed, I’m starting somewhere new and have promised myself that I’d get that exam out of the way before I start at the new place.

So the date is set for next week and I’ll be hitting the books from here till then, wish me luck; I really hope I pass this.

John.

Happy Anniversary, We're 5 years old!

Posted by John
on Wednesday, 12 September 2007

Looking back on the server logs it suddenly dawns on me, my pride and joy is now 5 years old, party!!!

That’s some History…

It’s been a rollercoaster ride. This site’s first incarnation appeared back on a very early incarnation of Blogger before Google bought them out. Then under the guise of wolfsclaw.com on a UK hoster running PHP 4 and Textile, then off to TextDrive PHP 5 and Wordpress for a while. Then over to DreamHost then MediaTemple Grid-Server → full DV box.

Now finally it’s sitting on it’s own custom Linux VPS server under Xen virtualisation, running Ruby on Rails with professional-grade deployment and load-balancing nodes. All made possible by SliceHost

It’s been quite a ride but I’ve enjoyed it and have no intention of letting up just yet.

Why do it?

I originally started the blogging idea as a means of putting myself out there, finding new friends, colleagues and quasi-self-promotion. But it’s thankfully grown away from that and now whenever I solve something difficult or write up some crackin’ solution it goes here.

I work on the notion if it’s helpful to me then it’s probably helpful to someone else out there, and if I end up making someone’s day then that’s thanks enough.

Still no Ad’s!

Yep I’m still sticking with my policy of no ad’s or annoying popups on the site, financing it out of my own pocket for the greater good.

Hackers go Bye Bye!

And having had no major break-ins or take downs in it’s history, life’s been mighty nice.

I’ve implemented load balancing on the web server to keep the Digg effect from happening and have a nice pool of bandwidth and processor resources and nightly disk imaging to keep things secure and bullet-proof.

Numbers?

If your interested, the logs suggest around 3,000 visitors a day, averaging 60,000 a month. Google Analytics tracks the details for me and sends a graphical chart each month, so far 200 goal achivements per month can’t be bad!.

Looking forward to the next 5!

Take care all,

‘Goodnight and Good Luck’