Android

Introduction

Wordpress

A “LAMP” stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.

In this guide, we’ll get a LAMP stack installed on an Ubuntu 16.04 Droplet. Ubuntu will fulfill our first requirement: a Linux operating system.

Step 1: Install Apache

The Apache web server is among the most popular web servers in the world. It’s well-documented, and has been in wide use for much of the history of the web, which makes it a great default choice for hosting a website.

We can install Apache easily using Ubuntu’s package manager, apt. A package manager allows us to install most software pain-free from a repository maintained by Ubuntu.



For our purposes, we can get started by typing these commands:

That’s it. To check if Apache is installed, direct your browser to your server’s IP address. The page should display like this :

programmingschool.io

Step 2: Install MySQL

MySQL is a powerful database management system used for organizing and retrieving data

To install MySQL, open terminal and type in these commands:

During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.

Once you have installed MySQL, we should activate it with this command:

Finish up by running the MySQL set up script:

The prompt will ask you for your current root password.

Type it in.

Then the prompt will ask you if you want to change the root password. Go ahead and choose N and move on to the next steps.

It’s easiest just to say Yes to all the options. At the end, MySQL will reload and implement the new changes.

Once you’re done with that you can finish up by installing PHP.

Step 3: Install PHP

PHP is an open source web scripting language that is widely use to build dynamic webpages.

To install PHP, open terminal and type in this command.

Congratulations! You now have LAMP stack on your droplet!

Step 4: RESULTS — See PHP on your Server

Although LAMP is installed, we can still take a look and see the components online by creating a quick php info page

To set this up, first create a new file:

Add in the following line:

Then Save and Exit.

Restart apache so that all of the changes take effect:

Finish up by visiting your php info page (make sure you replace the example ip address with your correct one):

It should look similar like :

programmingschool.io

Happy Codding !!!

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here