Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

4 Answers

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

or

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
add comment

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.