Server Fault is a question and answer site for system and network administrators. 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

Although I have an overview of running commands like apt-get install apache2 what I don't know is what order I should run them in to get a LAMP server running.

Also, I assume I should create a /var/www to put my sites in there (want about 4 domains pointing to this server.

As I have a clean slate, would be great to get advice on the correct way to get set up.

(as a side note, I want to replicate these settings in vagrant/puppet)

share|improve this question
up vote 2 down vote accepted

There is a very easy way to do this in Ubuntu, run the command

sudo tasksel

It will provide you a list of items to install, scroll down to LAMP and press the space bar to select it, then press enter, it will install all the pre-requisites required and it will all be preconfigured.

share|improve this answer
tasksel: aptitude failed (100)? :-( – John Mee Dec 14 '12 at 6:46
  1. Install apache ( sudo apt-get install apache2 ) and test the results
  2. Install PHP5 ( sudo apt-get install php5 libapache2-mod-php5 ) - restart apache2 ( /etc/init.d/apache2 restart ) - create under /var/www/ a file named test.php with the following code in it "" ; test with
  3. Install mysql ( sudo apt-get install mysql-server); dont forget to set a root password ( mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YourPasswordHere'); )
share|improve this answer
thanks - sounds simple enough! But what about things like mysql-client ? – ed209 Aug 2 '12 at 9:02
You can install mysql-client along with mysql-server. – Ionut Aug 2 '12 at 9:13

Your Answer


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.