LAMP STACK

Durga Sai Kumar Thulluru
4 min readJan 9, 2024

--

What is LAMP Stack? (stackify.com)

To do this project fork my git hub repository: Durgathulluru/LAMPstack: This Is a LINUX APACHE MYSQL PHP project (github.com)

# Small Introduction On Stack:
What is a Technology stack?
A technology stack is a set of frameworks and tools used to develop a software product. This set of frameworks and tools are very
specifically chosen to work together in creating a well-functioning software. They are acronymns for individual technologies used
together for a specific technology product. some examples are…

- LAMP (Linux, Apache, MySQL, PHP or Python, or Perl)
- LEMP (Linux, Nginx, MySQL, PHP or Python, or Perl)
- MERN (MongoDB, ExpressJS, ReactJS, NodeJS)
- MEAN (MongoDB, ExpressJS, AngularJS, NodeJS
# Step 0 — Preparing prerequisites
In order to complete this project you will need an AWS account and a virtual server with Ubuntu Server OS.

[AWS](https://aws.amazon.com/) is the biggest Cloud Service Provider and it offers a free tier account that we are going to leverage for our projects.

Do not focus too much on AWS itself right now, there will be a proper Cloud introduction and configuration projects later.

Right now, all we need to know is that AWS can provide us with a free virtual server called EC2 (Elastic Compute Cloud).

Spinning up a new EC2 instance (an instance of a virtual server) is only a matter of a few clicks.

You can either Watch the videos below to get yourself set up.

1. AWS account setup and Provisioning an Ubuntu Server
2. Connecting to your EC2 Instance

Or follow the instructions below.

1. Register a new AWS account following this instruction.
2. Select your preferred region (the closest to you) and launch a new EC2 instance of t2.micro family with Ubuntu Server 20.04 LTS (HVM)
launch EC2

IMPORTANT — save your private key (.pem file) securely and do not share it with anyone! If you lose it, you will not be able to
connect to your server ever again!

For Windows users, you will need a tool called putty or you can also use Mobaxterm to connect to your EC2 Instance. Download Putty Here and to download free version here Mobaxterm .
For Mac users, you can simply open up Terminal and use the ssh command to get into the server.

IMPORTANT NOTICE
Both Putty and ssh use the SSH protocol to establish connectivity between computers. It is the most secure protocol because it uses
crypto algorithms to encrypt the data that is transmitted — it uses TCP port 22 which is open for all newly created EC2 intances in
AWS by default. Most of these terminologies will make more sense to you as you proceed. So for now, if nothing makes sense, just
ignore. But be assured that the information is already registered in your sub-conscious mind. So it will become useful to you soon.

project1-step0

STEP 1 — INSTALLING APACHE AND UPDATING THE FIREWALL

```
#update a list of packages in package manager
sudo apt update

#run apache2 package installation
sudo apt install apache2
```

To verify that apache2 is running as a Service in our OS, use following command

sudo systemctl status apache2

STEP 2 — INSTALLING MYSQL

$ sudo apt install mysql-server

When the installation is finished, log in to the MySQL console by typing:

$ sudo mysql

Set a password for the root user, using mysql_native_password as default authentication method. We’re defining this user’s password as PassWord.01.

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PassWord.1';

Exit the MySQL shell with:

mysql> exit
$ sudo mysql_secure_installation

For the rest of the questions, press Y and hit the ENTER key at each prompt. This will prompt you to change the root password, remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MySQL immediately respects the changes you have made.

$ sudo mysql -p

Notice the -p flag in this command, which will prompt you for the password used after changing the root user password.

To exit the MySQL console, type:

mysql> exit

STEP 3 — INSTALLING apache2

To install these 3 packages at once, run:

sudo apt install php libapache2-mod-php php-mysql

At this point, your LAMP stack is completely installed and fully operational.

  • Linux (Ubuntu)
  • Apache HTTP Server
  • MySQL
  • PHP

FOR CREATING A VIRTUAL HOST FOR YOUR WEBSITE USING APACHE AND ENABLE PHP ON THE WEBSITE: The whole project is available in my git hub repo here : “Durgathulluru/LAMPstack: This Is a LINUX APACHE MYSQL PHP project (github.com)” in easy 5 steps and you will understand in deatail.

--

--