fbpx

Introduction

The LAMP stack (Linux, Apache, MySQL, PHP) is a group of open source software that is typically installed together to enable a server to host dynamic PHP websites and web apps.

This guide includes the steps to set up a LAMP stack on Ubuntu 14.04, if you want more information on LAMP click here.

Β 

Installing Apache

Step 1: Update apt-get package lists

sudo apt-get update

1

Step 2. To install Apache write down run the following command.

sudo apt-get install apache2 apache2-utils

When prompted for yes or no β€œ[Y/n]”, press y, and enter.

2

Step 3. Now run the command, to start Apache

sudo service apache 2 restart

Checking:

Open your favorite Web browser and go to the URL: http://localhost : if you read “It works!”, which is the content of the file /var/www/index.html , this proves Apache works.

3

Installing MySQL

Step 4. Now to install MySQL, write down the command below and hit enter.

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

4

Again when asked for β€œ[Y/n]”, you know which one to press, yes, you have to press β€œy” for yes.

Step 5. Setup a password for MySQL, and be sure to set something that you won’t forget.

5

Retype the password.

6

Step 6. Now run the command

sudo mysql_install_db

7

Step 7. And then the command, to secure MySQL installation.

sudo mysql_secure_installation

Note: Now Ubuntu will ask you a bunch of questions, read them carefully and according to your choice press β€œy” or ”n”.

8

Installing PHP5

Step 8. Now we arrive at the Lonely Mountain, PHP5, to install, run the command

sudo apt-get install php5 php5-mysql php-pear php5-gd php5-mcrypt php5-curl

9

Checking:

To check run the following two commands, consecutively.

  1. sudo touch /var/www/html/phpinfo.php
  2. sudo nano /var/www/html/phpinfo.php

10

Now the file Β phpinfo.php will open up on your terminal.

copy the php command:

<?php phpinfo();?>

and go back to your terminal.

11

Open up your web browser, and go to : http://localhost/phpinfo.php . or just click here.

12

Categories: Tutorials

1 Comment

HOW TO INSTALL WORDPRESS ON APACHE SERVER, UBUNTU 15.10 – Virtono Community · August 16, 2016 at 1:18 PM

[…] Set up a LAMP stack on Ubuntu 14.04 […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.