Linux (28) Python (13) Raspberry Pi (5) Bugs (3) Install (3) C (2) Brainf**k (1) HTML (1) Maths (1) Sorts (1)

Thursday, 9 November 2017

How to install a LAMP stack on Ubuntu server 16.04

A LAMP stack is a Apache web server that runs on Linux and has PHP and MySQL capabilities.
Firstly, we need to update the package lists:
sudo apt-get update
Installing the Apache web server:
sudo apt-get install apache2
Testing the web server:
Find the local ip address of the server:
Now when you visit this ip address in a browser you should see a page that looks something like this:

Installing PHP:
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
Installing MySQL:
sudo apt-get install mysql-server
Setting up MySQL:
When installing mysql you will be asked for a root password for the MySQL-server.