Quick & Easy Virtual Box LAMP Stack Setup

Created: Sept. 11, 2020 |  Modified: Sept. 11, 2020 |  Categories:  macOS   Linux   Web Development  

  1. Download and install Virtual Box:
    1. https://www.virtualbox.org
  2. Navigate to https://www.turnkeylinux.org/lamp and download the latest version of the virtual machine file.
    1. At the time of this writing:
      1. https://www.turnkeylinux.org/download?file=turnkey-lamp-16.0-buster-amd64.ova
  3. Open Virtual Box and click import. Select the file you just downloaded and continue with the default options.
  4. Start the imported VM.
    1. For me, it was named TURNKEY LAMP.
  5. Make note of the web and SSH addresses displayed at the end of the setup process.
  6. SSH into the server using a terminal and the address provided above.
  7. Navigate to the /var/www directory.
    1. cd /var/www
  8. Create a directory called <my_directory> and within that directory create a file called index.html.
    1. mkdir <my_directory>
    2. touch index.html
    3. Using your editor of choice add the following code to index.html:
        <!DOCTYPE html>
        <html>
            <head>
                <title>Quick Virtual Box Server</title>
            </head>
            <body>
                Hello World!
            </body>
        </html>
  1. Navigate to http://<host_address>/<my_directory>/.
    1. <host_address> was given in step 5.
  2. If you see Hello World, the Virtual Box server is setup and /var/www/<my_directory> can be used for serving files.