How to Set Up a Lightweight LAMP VM

If you need to quickly setup a lightweight LAMP (Linux, Apache, MySQL, PHP) virtual server for testing or presentation, the guide below will teach you how to do so. Download and install VirtualBox from [https://www.virtualbox.org/wiki/Do...

Method 1 of 3:

Downloading the Components

  1. Download and install VirtualBox from its official website
  2. Download and install a Linux distribution of choice. There are many options available (such as Debian, Ubuntu, RedHat, etc.) but for a lightweight server, Damn Small Linux will work well. You can get it here
Method 2 of 3:

Setting Up the Virtual Machine

  1. Create a virtual machine in VirtualBox by following the procedure below. Remember to use this configuration only.

  2. Picture 1 of How to Set Up a Lightweight LAMP VM
    Click on the 'New' button to start the Virtual Machine creation wizard.
  3. Picture 2 of How to Set Up a Lightweight LAMP VM
    Name your Virtual Machine and choose Linux. Choose the distribution using the version selector. If you're using Damn Small Linux, click on "other Linux".
  4. Picture 3 of How to Set Up a Lightweight LAMP VM
    Allocate 1 GB of RAM to the machine. If you're running VirtualBox on a computer with 1 GB RAM, allocate 512 MB. However, the performance may suffer.
  5. Picture 4 of How to Set Up a Lightweight LAMP VM
    Choose 'Create a hard disk now' as your hard disk configuration.
  6. Picture 5 of How to Set Up a Lightweight LAMP VM
    Choose 'VirtualBox Disk Image' as your hard disk type.
  7. Picture 6 of How to Set Up a Lightweight LAMP VM
    Select the fixed size radio button and click next. Allocate 8-10GB of hard drive space for the Virtual Machine.
  8. Wait for the hard disk to be created, and finish the wizard.
  9. Click on the Settings button after selecting the Virtual Machine you just created.
  10. In the storage menu, click on the add new button denoted by a floppy with a plus sign on it.
  11. Click on add CD/DVD device and select choose disk. Choose the Damn Small Linux ISO and click OK.
    Picture 7 of How to Set Up a Lightweight LAMP VM
  12. Picture 8 of How to Set Up a Lightweight LAMP VM
    Configure the network adapter. Click on the network menu, and under adapter 1, select bridged adapter.
  13. Under the USB menu, disable the USB controller.
  14. Click on the Audio menu and disable Audio. Close the settings menu.
Method 3 of 3:

Installing and Configuring DSL with XAMPP

  1. Start the VM and boot to CD
  2. Type install at the prompt.
  3. Select option 2 to install DSL to the hard disk.
  4. Type "HDA" at the prompt asking you which drive to install to.
  5. Type yes to everything, and when choosing boot loader, select LILO.
  6. Reboot the Virtual Machine
  7. Type a root password at prompt.
  8. Type a DSL password at prompt.
  9. Login as the root user.
  10. Select the first option (xVesa) for xserver.
  11. type n to USB mouse.
  12. Type y to PS/2 Mouse.
  13. Pick your resolution and color depth.
  14. Answer no to the prompt seeking dpi.
  15. Check if the IP of your VM is listed on the right after logging in.
  16. Open the browser and download Xampp from here
  17. Find the package. By default xampp-linux-1.8.1.tar.gz will save to /root when downloading from a browser
  18. Launch a ROOT terminal and type: tar xvfz /root/xampp-linux-1.8.1.tar.gz -C /opt
  19. After install completes, make lampp start at bootup. To do this, type:echo /opt/lampp/lampp start>>/opt/bootlocal.sh
  20. Edit the file http-xampp.conf by completely commenting out the last section "New XAMPP security concept" (Commenting out is done by adding a "#" at the beginning of the line).
  21. Type nano /opt/lampp/etc/extra/http-xampp.conf
    1. Once you're done commenting out each line of the "New XAMPP security concept" section, save it by pressing CTRL + X and respond with Y to the question.
    2. This will allow you access phpmyadmin without getting 'access forbidden' message
  22. Reboot and you should see the LAMP services start up.
    1. You can then log-in and open the browser to localhost to configure LAMP settings or open a browser on any computer within the network with the IP of the VM (As long as the network adapter is in bridge mode and your host firewall [Host = system VirtualBox is installed on] doesn't block it).
Update 05 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile