Creating a plain Ubuntu Server 12.04 LTS on Virtualbox; notes on Apache + Python options

I need to be working on budget proposals today. SIgh. So, in a fit of classic avoidance behavior, I decided to jot down a set of notes and links for configuring Ubuntu Server 12.04 (LTS) under VirtualBox, primarily so that I can experiment with some Python + Apache stuff. Here you go – this is very rough, as I was just trying to get things out of a jumbled set of Google searches and into some sort of order.

  1. Install VirtualBox 4.2 (
  2. Install VirtualBox extension pack for 4.2 (same place)
  3. Visit . Choose the LTS 12.04 version.
  4. Download ISO – it’s about 657MB in size.
  5. Install and configure Ubuntu. Create an administrative account, like “manager”, “installer”, etc. This will be the account that can sudo.
  6. Install the VB guest additions if you think that you will need them.
  7. Install ssh and apache: sudo apt-get install ssh apache2
  8. Consider configuring the virtual box to be NAT with port-forwarding so that you can SSH in, etc.
    1. A quick side-note on this. On the Mac, at least, it’s painful trying to use the GUI to forward ports from the NATed guest to the host. Here’s a quick and hackish way to manually set them.
    2. Shut down the guest first because you’re going to manually edit its config file. Assume that the machine is called “UbuntuServer” in VirtualBox.
    3. Navigate to “VirtualBox VMs/UbuntuServer” in your home directory on your Mac. Edit the file labeled “UbuntuServer.vbox”. Do a search for “<NAT>”. Add the following lines to the NAT paragraph:
      1. <Forwarding name=”HTTP” proto=”1″ hostport=”9980″ guestport=”80″/>
        <Forwarding name=”SSH” proto=”1″ hostport=”9922″ guestport=”22″/>
      2. Save the file and exit. When you restart the guest, you will be able to connect to the guest Apache by visiting – http://localhost:9980 and you’ll be able to ssh into the guest by doing “ssh installer@localhost:9922”.
  9. Verify that you get the “It works” page when you visit “http://localhost:9980&#8221;.
  10. Do apt-get update && apt-get dist-upgrade.
  11. Stop. Make a snapshot or a clone of your nice pristine VB machine of Ubuntu server 12.04 with Apache. Not using snapshots and clones? You really should be. It’s a great and often overlooked feature.
  12. If you want, you can follow the LAMP server installation instructions from Falko Timme here:
  13. For the Debian/Ubuntu way to manage multiple sites and virtual hosts, see the following:
  14. Configuring python support within Apache2
    1. If you want to write cgi for Apache with python use mod_wsgi anyway. See these notes ( and these notes (
    2. Alternatives to the long-dormant mod_python:
    3. Low-level frameworks (non-Django) – see Flask (
    4. Django:
  15. Consider installing Postgresql. Follow instructions like these:

Take a break – you’ve earned it. 🙂 See any errors? Have any comments? Let me know. As usual, I’m just gathering resources from around the web. Thank you to all of the experts who write down and share their knowledge with the rest of us!


2 thoughts on “Creating a plain Ubuntu Server 12.04 LTS on Virtualbox; notes on Apache + Python options

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s