Monday, September 14, 2015

Setup Virtual LAMP Server - Install VirtualBox

In this module...

In my previous blog post, we talked about creating our own virtual LAMP server for the purpose of not only having a contained web development but also a way to learn how to manage our own servers. In this blog post, we are looking at the first step which is to install a virtualization software on your host laptop.

For the virtualization software, I pick VirtualBox (or VBox) cuz it is free. You can beat its price here. I have been using VBox for a couple of years now - on both MacOSX host and Windows host with very good results. I don't even remember having any problem with any of the host systems. So it gets high vote of confidence from me.

The current software version is VirtualBox 5.0. I have version 5.0.4 running on my MacBook Pro, and version 4.3.30 running on my MacBook Air that I use when travelling. They work great. Either version would be fine.

There are also tons of information about virtualization on VirtualBox Wiki page. I also found very interesting information, especially for beginner. You can take a look at the First chapter of VBox Manual.

Getting the VirtualBox software

VirtualBox software is available at https://www.VirtualBox.org/wiki/Download.

On the download page, you have choices of your host operating system or (host OS). This is the version of OS that you run on your laptop. For example, I have a MacBook running OSX, I would pick "VirtualBox 5.0.4 for OS X host amd64". The "amd64" bit tells you that the software is for a 64-bit OS - most of the newer OS are 64-bit nowaday.

Once you click on the appropriate link for your host, the software starts downloading. VBox version 5.0.4 for OSX is about 90Mbytes. So it is rather small by today's standard. Below the host OS, there is a link to "VirtualBox Extension package". The extension pack is really great if you want to connect your USB ports to the virtual host. We don't really need the extension pack for our virtual LAMP. But you can download and install it, if you want.

VirtualBox installation

When you click on the link to download, the software package is downloaded into your "Download" folder. On my Macbook, it is usually under ~/Downloads directory.

In this example, I have two version of VirtualBox that I downloaded.

The rest of the article will show a step by step of installing VirtualBox.

  • Next step is to install the software. Double click the "VirtualBox-5.0.4-102546-OSX.dmg" icon. The app will open a new window which will tell you how to install.
  • When you double click the "VirtualBox.pkg" icon, another dialog box shows up. This step, the software will check to make sure that your laptop could run the software.
    Click Continue
  • Another dialog box advice of how much disk space it will use. Click Install to go ahead with the installation.
  • Once again, you hit Install. OSX will ask you for your administrative password. Input your password and click Install Software
    If everything is good, you will see a couple more updates to the install dialog box.
    ... and finally, a message say "The installation was successful.
  • And we are done... So easy, I know right?

    We will go through running VirtualBox for the first time next time. We will also go over installing a Ubuntu server. See you next time.

  • Saturday, September 12, 2015

    Set up a LAMP server for Web Development - Intro

    What is this about?

    A lot of people like to learn more about Web development. But not everyone has access to a web server. And let's face it, having your own web server running on your laptop is nice, isn't it? What more is that you are also learning to manage a Linux/Ubuntu server. Double bonus!!!!

    Today I will talk about setting up a LAMP (Linux+Apache+MySQL+PHP) environment running as a virtual machine on your laptop. Since I have a MacBook Pro, this article will focus on the MacBook. The same procedure works for MacBook Air too.
    There are a number of virtualization products you can use on a Mac. My favorites are VMWare Fusion from VMWare, and VirtualBox from Oracle. Since VirtualBox is FREE, we will be using VirtualBox in this article.

    What do you need?

    • A laptop, obviously. Any laptop with multiple cores CPU and at least 4G bytes of memory would works. The LAMP server, surprisingly, does not need a lot of memory to run. 512M or even 256M is enough for a server without GUI. I am using a mid-2012 MacBook Pro with i7 and 16G. It is way overkill and not necessary. I also have a 11" Macbook Air with 4G mem and it is working fine.
    • A Virtualization software such as VirtualBox, or VMWare
    • Ubuntu 32-bit or 64-bit server software in ISO format

    In the next blog post, I'll go through the steps that I put these thing together.