LAMP Virtual Appliance

Linux Comments

Recently, I needed an Apache server to test a web application that I’m working on. In times past, that would have been a painful process. First I would have had to pick and install a linux distribution. Then install Apache and MySQL.

Now, however, with the increased popularity of VMware, there are many freely available virtual appliances that can easily be downloaded from the Web. After a little searching I found a LAMP virtual appliance at virtualappliances.net. LAMP stands for Linux, Apache, MySQL and PHP, all of which are pre-installed and ready-to-go. The Linux distribution is Ubuntu Server (which happens to be my preferred distro these days).

Once you have the virtual appliance downloaded and decompressed, you will need to install the VMware Tools in order to get decent performance. This was the tricky part with this virtual appliance. Ubuntu Server isn’t one of the officially supported distributions for VMware. That’s fine, though, because the VMware Tools installer will compile the drivers automatically for the installed Linux kernel if you do a little prep work first.

First, you’ll need to install gcc and the other default build tools (like make). The Ubuntu (and Debian) package manager, apt, makes this really easy:

apt-get install build-essential

You’ll need to run this as root (which is the default login for this virtual appliance). This command goes out to the Ubuntu servers and downloads the default build tools that VMware will need to compile the drivers.

apt-get install linux-headers-$(uname -r)

This downloads the appropriate linux kernel headers that VMware will need for a successful compile. After those two simple steps are complete, you can follow the standard VMware Tools install process. After selecting Install VMware Tools from the Virtual Machine menu, the process looked like this:

ubuntu-term-1.png

Don’t get hung up on the VMware Tools version, it will probably be different on your system. On most systems you don’t have to create the /media/cdrom directory, but this virtual appliance didn’t include it. That’s it, you now have a working LAMP (no pun intended).