Adding a Web Server to Ubuntu

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:05
    with Emma Jane Westby
  • 0:08
    In this lesson, we're
  • 0:09
    going to install an Apache, MySQL, PHP stack, or an AMP stack.
  • 0:14
    Seeing as we're doing this into a Linux server,
  • 0:17
    we're going to end up with a LAMP stack,
  • 0:19
    which you've probably heard before.
  • 0:21
    The first thing we're going to do is select a base box.
  • 0:25
    We'll look at the options for Ubuntu.
  • 0:29
    Then we'll initialize a new Vagrant instance, log into the server,
  • 0:33
    install tasksel, and then use tasksel to install our AMP stack.
Loading ...

Adding a Web Server to Ubuntu


In this lesson you will learn how to install a Web server on your virtual machine. Ultimately we will use a provisioning script to automate this task, but this lesson shows you the virtual machine is just like any other server you might have worked with in the past. Any time you want to add new software, you can always come back to this lesson if you (for some reason) don't want to create a recipe and re-provision your machine. Hopefully, though, by the end of this series you'll see why provisioning is a more robust solution than installing software directly.

Lesson Outcomes

By the end of this lesson, you will be able to log into your virtual machine, and use the command line to install new software.

Lesson Summary

  1. Navigate to
  2. Locate a base box you would like to use. Ensure you are matching the "provider" to what you have. e.g. VirtualBox for these lessons (not VMware).
  3. At the command lines, initialize your new server:

Ensure your server is up and running, and then log in with the command: vagrant ssh. This command must be issued from within the directory which contains the file Vagrantfile.

Install an AMP server using the directions for your base box. We'll use the same technique as is covered in the lesson Installing a Web Server on Ubuntu.

  • $ sudo apt-get install tasksel
  • $ sudo tasksel install lamp-server

This will install Apache, MySQL, and PHP.

To confirm the server is running, use the command: pstree.

Troubleshooting and Gotchas

  • OSX can use vagrant ssh; Windows will need to install PuTTY and use ssh vagrant. Using PuTTY is covered in the bonus lesson for this series.
  • If you get the error tasksel: aptitude failed (100), run the following commands:
    1. $ sudo apt-get update
    2. $ sudo tasksel install lamp-server 
      (I got this error on a precise32 base box with a Windows 8 host running inside of Parallels on a Mac OSX machine.)

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.