Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a Windows user and will like to setup a LAMP stack in VirtualBox as a test web server. How do I install the AMP software?

I read I should use:

sudo apt-get install apache // Do I use apache2 here?
sudo apt-get install mysql
sudo apt-get install php

Use of sudo apt-get install is simple enough, even simpler that Windows. But how do I know what "install key", for example apache vs apache2 I should use? Plus I see in sites I found from Google, that I must install the various PHP modules for Apache/MySQL, etc. How do I know what I require?

Where possible, I don't intend to install from source.

share|improve this question
up vote 1 down vote accepted

When you install Ubuntu, there's an option to configure the machine as a LAMP server.

But if you forgot to do that, just run one of these commands:

sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server


sudo tasksel install lamp-server

The former is the "brute force" way of installing all the components of the LAMP stack, while tasksel appears to be the same tool used by setup.

As Neal mentioned, a meta-package like apache2 will actually install several packages. In addition, you'll be prompted to install any missing dependencies.

If it turns out that you need some other packages, too, you can always install those later.

share|improve this answer

The apache2 package in Ubuntu is a meta-package - it just pulls in all the required stuff. Similarly the packages mysql-server and php5 are packages that point to the current implementation of the mysql server and php.

Installing these should get you up and running.

share|improve this answer

This is a good tutorial on how to set up a secure webserver based on Apache, PHP and SuExec.

While it is easy with getting up and running with the above mentioned commands, you shouldn't neglect security even if you'll be hosting just one website.

If you're planning to host two or more you really should think about using SuExec to prevent one vHost being able to read (and most probably even write) the others content.

share|improve this answer

You could also just open up System -> Administration -> Synaptic Package Manager then hit "Edit" and then "Mark Packages By Task...". In the window that opens up, tick "LAMP Server".

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .