Install LAMP on Ubuntu Wily Werewolf

Posted by cshaw on Dec 6, 2015 6:54 PM EDT
Christopher Shaw Portfolio; By Christopher Shaw
Mail this story
Print this story

The LAMP stack powers most of the web, and here I will show you how to easily install on the latest Ubuntu release.

What is LAMP? A Lamp stack is a group of software with different purposes which when working together produce a web server capable of delivering content. The software in the Lamp stack are; - Linux (The Operating System) - http://www.ubuntu.com/ - Apache (The Server Application) - http://www.apache.org/ - MySQL (The Database Application) - http://www.mysql.com - PHP (The dynamic language) - http://www.php.net/

Although technically, you could run a LA stack ( Linux and Apache ), without a database and a dynamic language, you will only be able to serve static content.

Why use LAMP? LAMP is a reliable stack for producing dynamic content and serving to the web, it has been round for decades and proven its robustness which makes it ideal for its purpose. It is used my much of the web and powers major sites along side smaller sites. Originally Facebook was using the LAMP stack, but heaven knows what they really use now.

Installation Installation varies on what version of linux you are using, thanks to the array of package managers out there. As Ubuntu is my preferred OS, these instructions are for Ubuntu only.

1) Update the System Run the following command to update the package manager (apt)

sudo apt-get update



2) Install Apache The following will install Apache, the server application.

sudo apt-get install apache2



3) Check Apache Open your browser to http://localhost/ and you will be presented with the following image, this confirms apache is installed and running.



4) Install the Database For this we need both the mysql-server package, and the php5-mysql package. The latter allows PHP to connect to the database.

sudo apt-get install mysql-server php5-mysql



During installation you will be prompted to create a password for the root mysql user, set something you will remember, but it needs to be secure. I would recommend a combination of Upper Case, Lower Case and Numbers.

5) Install PHP

sudo apt-get install php5 libapache2-mod-php5



6) Test PHP Create a new file called index.php in /var/www/html/

<?php

echo 'hello';

Then open the browser to http://localhost/index.php and if you see the word 'hello' then php is working.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Apache, Linux, MySQL, PHP, Ubuntu

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.