Web development on Ubuntu

January 11th, 2010 2 comments »

I get it. You’re a Windows person, always have been and always will be. Ok, you’re not a total n00b either. You’ll use the latest Firefox (even Chrome, but you’re a little suspicious about its privacy implications). For LAMP coding you’ve set up XAMPP and code with Notepad++. You’ll use TortoiseSVN to commit coding changes, and you’ll load up Putty to finally update your product web site. And you’re actually pretty happy with your Windows 7 setup (hey, I like it too).

But I’ve made the switch, and you and your pet dog Pudgie could too. Given that you’re not a total n00b, you should consider using Ubuntu for your daily life, and particularly for coding that amaaaazing web site idea you have that lets users schedule their coffee breaks with long lost school friends. Oh, and it has an AJAX-y frond end with widgets and lots of buttons. Ubuntu is nicely set up for this, whatever your online project. Actually, you’ll even come to like that you can SSH and SVN directly through the terminal.

Apache and MySQL feel more at home here, while XAMPP on Windows has always acted a bit like a shady character that you’re never too sure what it’s going to do next. I was sick of the start-stop services of XAMPP. It’s like trying to use Safari under Windows, it just doesn’t feel right. And try letting Apache start with the rest of your crawling Windows installation, haha no thanks!

To give you a flavour, here’s what my Ubuntu desktop could look like if I was doing web development and happened to keep my windows nice and orderly:

An (orderly) view of my LAMP development on Ubuntu.

An (orderly) view of my LAMP development on Ubuntu.

Still a bit unsure about this Linux thing? It’s easier than it used to be. Just set up a virtual machine with a copy of Ubuntu running on it. No need to do a nasty dual-boot setup. (Later on, I bet you’ll be installing Ubuntu and virtualising Windows).

Ok, you’re almost there.You’ll need to install some extra components (although if you install Ubuntu server edition I think a lot of these are already set up for you).

Coding editor. Ubuntu already comes with a text editor called gEdit. Change the colour scheme to Oblivion, show the File Browser menu on the left and you’ll have an instant coding environment:

Gedit text editing program that's shipped with Ubuntu.

Gedit text editing program that's shipped with Ubuntu.

Apache, MySQL, phpmyadmin: With Ubuntu, you don’t have to trawl the web for software downloads of supported packages. Just install them directly through the system’s package manager.

Subversion: In the same manner as above, install SVN. You’ll be able to update/commit directly in the terminal. Now that you can use the Synaptic Package Manager, grab yourself a copy of Firefox too.

That wasn’t so bad, was it? Now you’re running on a free operating system that’s being constantly updated. If you’ve gotten this far, I now declare you an Ubuntu fanboy :P The only reason I still use Windows 7 is when I need to use Lightroom for my photo collection, but that’s a different (virtualisation) story!

Multiple operating systems – Virtualisation

November 16th, 2009 2 comments »

The era of dual-booting my desktop PC may have come to an end. Using Ubuntu as my primary operating system, I can now just run other operating systems on top of it using virtualisation. The idea has been around for a few years, and is matured enough to use reliably one your home computer.

I’m still relatively uneducated about virtualisation. As I understand it, it allows you to boot up your PC as usual, but then you can run other operating systems ‘within’ it, as if they were normal applications running on your PC. As far as I understand, with the normal virtualisation setup will need you to run at least one primary operating system normally (while enterprise-level tools may break away from this requirement).

So let’s jump straight in to how you can set this up on your system. This is the “host” operating system. Any virtualised machine running on top of it will be called the “guest”.

How to get virtualised

It’s this easy to run other operating systems on top of your normal one:

  1. Install Sun’s VirtualBox. It’s an open source virtualisation platform (very complex programming underneath the hood). It’s easy to use!
  2. Create a new virtual machine. This is the machine on which you’ll install an operating system.
  3. Boot up your virtual machine!

Pics or it didn’t happen!

Ubuntu is the operating system that I used as normal before any virtualisation setup.

I installed the VirtualBox application on Ubuntu, which then looked like this (you can see I already installed one virtual machine):

VirtualBox virtualisation application running on Ubuntu.

VirtualBox virtualisation application running on Ubuntu.

I then created a new virtual machine using the simple menus. Using an ISO image of Ubuntu Netbook Remix operating system, I installed it on the virtual machine. After booting up the virtual machine, that Ubuntu Netbook is then running as a guest its own window on the host. If you have the licenses, you could also run Windows XP and Windows 7 as guests in other windows in parallel, for example.

Here’s Ubuntu Netbook running as a guest on my desktop, on top of standard Ubuntu:

Ubuntu Netbook Remix running within VirtualBox.

Ubuntu Netbook Remix running within VirtualBox.

Bonuses

Each virtual machine created in VirtualBox is just a file on your actual hard drive. This means that the file can be backed up to store a “snapshot” of your guest operating system. If you make too many message installations on the virtual machine, you can just roll back to a previous snapshot you took.

Virtualised web hosting: The server which served you this web page is also coming from a virtualised operating system, offered by Servint. This feature allows me to rent a server running as a virtual machine (a “virtual private server”), which is cheaper because I’m sharing the hardware with other virtual servers, but it also has good performance as it has guaranteed minimum RAM and processor usage. It’s reliable too, as any other virtual server that crashes on the same hardware will never affect the reliability of my own virtual private server. Read more about eTeanga’s VPS hosting experience.

A glimpse into the early Web

November 3rd, 2009 No comments »

We take a lot of the Web for granted. Things “just are”, but it’s not really that long ago that HTML and HTTP standards were being discussed and were still “under construction”.

Mark Pilgrim shows quotes from a mailing list including Marc Andreessen and Tim Berners-Lee. The discussion is about introducing a new IMG tag to be used in HTML documents to be able to include images in the page.

What seems like such an arbitrary discussion affects coding structures that are directly used still, about 20 years later.

Hosting with a Virtual Private Server

August 8th, 2009 1 comment »

This page links to a commission-paying link for a service I’ve used for years.

You can get web site hosting dirt cheap these days.

If you’re looking at dirt cheap hosting, it’s most probably shared hosting. This means that you’re sharing the server with lots of other sites, and you probably don’t have access to configure any of the services offered to you.

VPS (Virtual Private Server)

If you’re a bit nerdier like me, though, you’ll probably have fun running your own VPS. This is a whole step up from shared hosting – you basically run your own server.

The only catch is that your virtual “server” is sharing the same hardware with a few other virtual “servers”. This virtualisation allows you to run a fully self-contained server, while not paying for using all the hardware.

When I say you get a server, I mean that with a VPS you can:

  • SSH to your server to control it at the command line
  • Fully configure Apache, MySQL through config files, log files, custom timeouts – whatever you want.
  • Guaranteed RAM and CPU cycles.
  • Install git for version control.

Why I went for Servint

I’m not a Linux command line pro. Actually, I felt a bit lost there at the beginning. Instead of going for a blank canvas approach such as Slicehost, I opted for Servint which is a fully managed VPS. This means that if something goes wrong, if I mess up Linux or Apache, their 24/7 support guys will fix it.

Try out Servint if you want more than just shared hosting. The page you’re reading right now was served by that VPS. It takes a bit of server juice to serve all those dynamic pages, especially at peak times.

Get hosted with Servint VPS hosting.

Fail cat at a totally new level

July 24th, 2009 No comments »


Catcerto.

Film a cat playing the piano, and write an concerto to accompany it.

http://www.youtube.com/watch?v=zeoT66v4EHg&

Sweet. CMS+Blog on WordPress

July 17th, 2009 5 comments »

To set up WordPress for both CMS and Blog:

  1. Create a Page and call it “Home”. This is your default home page.
  2. Create a Page and call it “Blog”. This will show in /blog/.
  3. In Settings -> Reading,
    1. Set to show “Home” as the static page for Pages
    2. Set “Blog” as the static page for Posts.
  4. In Settings -> Permalinks, change the “Common” rule to /blog/%postname%.
  5. Ta da! Your pages will be created as mysite.com/page/ and your blog posts will appear in mysite.com/blog/post/.

After 7 years of using handmade PHP pages on LearnIrishGaelic.com, I finally moved the site over to a WordPress installation.

What this means is that I have one of the most mature web application at my fingertips. Adding a new page no longer means creating a new PHP page, and worrying about how to update my navigation menus.

What’s better, I read Brian Yerkes writing about how to use WordPress both as a CMS and Blog. This means that the main part of your site can be static pages, while WordPress still handles /blog/ as a blogging application. Follow the settings above to get your own CMS powered by WordPress, while having a blog section.

Taking doubt out of the checkout process

July 1st, 2009 No comments »

learn-irish-gaelic

Handing your hard-earned cash to to an online vendor can be hard to decide on, especially if it’s a small site you’re not familiar with. I’m always highly suspect of a site promising to ship something out to me.

So I was thinking about how to optimise the visitor’s process on LearnIrishGaelic.com where I sell some language learning software.

I’ve made a small change online. Instead of guessing when you’ll receive your order (“within 10 days”), I’ve added “Next dispatch date” and “Your order will be delivered by…” date to the shipping information.

Hopefully just another small bit of information that will help you decide to splash out on a learn-at-home Irish language product ;)

Newstalk.ie not coping with news traffic

June 7th, 2009 1 comment »

croppercapture1

Yesterday was the first day of counting in Ireland’s 2009 Local and European elections.

There will always be some spike in traffic to a news website around a big event such as an election. These are the most crucial times for a news site.

This is why a news site’s server should be prepared for unexpected traffic spikes. Unfortunately, Newstalk.ie (a good radio station) is down, presumably because of people trying to get up to date on the latest election news.

Tip to Newstalk: beef up your server and check your Apache settings ;)

Install Google Chrome on Ubuntu – Early Access Release

June 6th, 2009 1 comment »

chrome-on-ubuntu

At the time of writing, Google have released the very first Chrome-branded browser on Linux (in my case Ubuntu).

To install Google Chrome on Ubuntu, follow this download information link.

As the Chromium blog states:

… whatever you do, please DON’T DOWNLOAD THEM!

From what I understand, this current release of Google Chrome on Ubuntu is basically a branded version of the Chromium browser which is in pre-alpha stage for the Linux platform.

Go ahead and install it for the fun of it. You won’t even have a Flash plugin for the browser yet, but it’s being constantly updated.

Google Wave will modularise and simplify!

May 29th, 2009 No comments »

google-wave

Technologizer asked about the newly announced Google Wave whether the application is bloatware.

Screenshots show a service [...] less an example of Google-esque minimalism and more like a Microsoft app that’s been through a few versions and is shoehorning stuff in.

Good point. Google Wave is a complicated application.

Wave has “Spelly” which is a context-sensitive spell checker based on existing text found in Google index of the web.

Wave lets you collaboratively edit in real time, which was the most difficult feature for them to develop.

It’s trying to do many things. The idea of Wave was probably interesting in the beginning, but as development went one they realised they needed to solve more problems.

But Google Wave will get simpler by necessity. It has “amazing potential” according to its authors, but so does Twitter. While building an Irish dictionary application I realised just how important it is to keep thing simple, stupid.

Update: Storm Alert blog reviews Wave’s internal architecture, and points to some major concerns of over complexity of the design of the system which will have to be worked on to help the maintainability of the overall system.