Installing a Virtual LAMPP Server with VirtualBox and Ubuntu

Home / Guide / Installing a Virtual LAMPP Server with VirtualBox and Ubuntu

Part 1 Install Virtual Box

Download it free from virtualbox.org and run through the installer.

Part 2 Download the latest Ubuntu software.

I like the desktop version as I can do other things besides just run a server.

Download the ISO here:

http://www.ubuntu.com/getubuntu/download

Part 3 Install Ubuntu on VirtualBox

Launch VirtualBox and create an new virtual machine. When creating the machine, Virtual box will ask what type.

Name your machine: Ubuntu Server

Operating System: Linux

Version: Ubuntu

All the other settings are fine as they are setup by default.

Once you are back at the Virtual Box select a machine screen, double click on your new Ubuntu Server.

The first run Wizard appears. Follow the questions and when prompted to select the installation media, browse to the newly downloaded ISO you downloaded from above.

Just follow the directions to install Ubuntu. Nothing fancy. When you are installing, you will be asked to create an account. Make sure you run down the name of your Ubuntu server, your login and your password. I’m going to call my   mine ajbapps.

When you finish installing Ubuntu, you will be asked to restart your machine. Do so and then restart your machine and login.

Part 4 Installing VirtualBox Guest Additions

Once logged into the Ubuntu Server we are going to install the Virtual Box Guest Additions. From the menu of the running Virtual Box, click on Devices and then Install Guest Additions. A CD will be on your desktop of your Ubuntu Server once you click it.

This is where it goes a little off of the path. Only issue I have is that this needs to be installed via the terminal. Not difficult just a little of a learning curve.

So Click on Applications, then Accessories, then Terminal.

Browse to the folder with the Guest Additions with this command:

cd /media/cdrom/

then to install type in

sudo sh VBoxLinuxAdditions-x86.run

type in your password when prompted and let it install the system.

Reboot when it is completed.

Part 5 Configure VirtualBox

No let’s change the way Virtual Box uses your system so you can see the machine from the network. So at the very bottom of the Virtual Box window is a icon that looks like two screens together. Click on it and click on Network Adapters.

Adapter 1 will be selected. In that window

Next step – Installing the LAMPP server software Change the settings to:

Attached to: Bridged Adapter

Name: Select the adapter that you are using. If you are using a wireless network, choose it, etc.

Click OK and you are ready to use to.

Part 6 Change Root Password

We will need to changes some permissions before we setup the software, so we need to change the password for the root user to allow for this.

So from the System Menu, click Administration and then Users and Groups. In the window that opens, click on the keys near the bottom. Enter your password to unlock the admin tool. Then double click on the root user in the list.

In the window that opens, you can either set a password or generate one. Your choice. Make sure it is not the same as your login password, and make sure you write it down. Click OK to lock it in … and we are ready to install the software of the server.

Part 7 Download and Install XAMPP

We love XAMPP – it’s easy to use, full featured and in one package. So from your Ubuntu Server, fire up FireFox and get the latest version for Linux.

Download the package from here:

http://www.apachefriends.org/en/xampp-linux.html

For use the latest version is xampp-linux-1.7.3a.tar.gz

Once the tar.gz is downloaded… go back to your terminal window again. We want to install the software so we use this command:

su

This will change you to root. So put in your password we just set and the terminal will change to root.

Now type in:

tar xvfz Downloads/xampp-linux-1.7.3a.tar.gz -C /opt

This will install the software. Let it run until completion.

Once the installer finishes type in;

exit

If everything went according to plan you should be able to start up the server.

type in

sudo /opt/lampp/lampp start

and you will see:

Starting XAMPP 1.7.3a...
 LAMPP: Starting Apache...
 LAMPP: Starting MySQL...
 LAMPP started.

Success!

Part 8 Accessing Your Virtual Host

So now we can browse the network and see the server running.

Minimize your Virtual Box entirely and open up your favorite web browser on your main computer.

In the address bar type in the following:

If you are using Windows type in:

http://ajbapps/

if you are on a Mac type in:

http://ajbapps.local/

Change ajbapps to whatever you named your ubuntu machine when you installed it above in Part 3

You should see the XAMPP welcome screen and have a full PHP/MySQL server for developing on locally.

That’s the guide. If you have questions or comments or need help… post it in the comments.

%d bloggers like this: