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
- Download and install VirtualBox from its official website
- 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
- Create a virtual machine in VirtualBox by following the procedure below. Remember to use this configuration only.
- Click on the 'New' button to start the Virtual Machine creation wizard.
- 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".
- 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.
- Choose 'Create a hard disk now' as your hard disk configuration.
- Choose 'VirtualBox Disk Image' as your hard disk type.
- Select the fixed size radio button and click next. Allocate 8-10GB of hard drive space for the Virtual Machine.
- Wait for the hard disk to be created, and finish the wizard.
- Click on the Settings button after selecting the Virtual Machine you just created.
- In the storage menu, click on the add new button denoted by a floppy with a plus sign on it.
- Click on add CD/DVD device and select choose disk. Choose the Damn Small Linux ISO and click OK.
- Configure the network adapter. Click on the network menu, and under adapter 1, select bridged adapter.
- Under the USB menu, disable the USB controller.
- Click on the Audio menu and disable Audio. Close the settings menu.
Method 3 of 3:
Installing and Configuring DSL with XAMPP
- Start the VM and boot to CD
- Type install at the prompt.
- Select option 2 to install DSL to the hard disk.
- Type "HDA" at the prompt asking you which drive to install to.
- Type yes to everything, and when choosing boot loader, select LILO.
- Reboot the Virtual Machine
- Type a root password at prompt.
- Type a DSL password at prompt.
- Login as the root user.
- Select the first option (xVesa) for xserver.
- type n to USB mouse.
- Type y to PS/2 Mouse.
- Pick your resolution and color depth.
- Answer no to the prompt seeking dpi.
- Check if the IP of your VM is listed on the right after logging in.
- Open the browser and download Xampp from here
- Find the package. By default xampp-linux-1.8.1.tar.gz will save to /root when downloading from a browser
- Launch a ROOT terminal and type: tar xvfz /root/xampp-linux-1.8.1.tar.gz -C /opt
- After install completes, make lampp start at bootup. To do this, type:echo /opt/lampp/lampp start>>/opt/bootlocal.sh
- 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).
- Type nano /opt/lampp/etc/extra/http-xampp.conf
- 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.
- This will allow you access phpmyadmin without getting 'access forbidden' message
- Reboot and you should see the LAMP services start up.
- 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
You should read it
- How to Enable the Windows Subsystem for Linux
- How to set up a Windows virtual machine in Linux
- The Linux machine can be remotely hacked with a poisoned DNS response
- How to Create an ARM-Based Linux Virtual Machine with Azure
- Running Linux on Windows 10 does not require a virtual machine, here are 18 things you should know
- How to install and use Kali Linux on VmWare virtual machine
- What is welding machine? Classification of welding machines
- Error codes for washing machines Sanyo, LG, Toshiba
- What is KVM (Kernel-Based Virtual Machine)?
- How to prevent and handle when Windows Update deletes Linux
- Use variables in Shell
- How to Install KVM in Arch Linux and Configure Virtual Machine