larrymie / -PROJECT-1-LAMP-STACK-IMPLEMENTATION

LAMPSTACK PROJECT
MIT License
0 stars 0 forks source link

I added 17 Images for my LAMP STACK IMPLEMENTATION Project 1 #1

Open larrymie opened 3 years ago

larrymie commented 3 years ago

01 02 nt.com/91284177/137761224-de05a37b-11a6-4e9c-b78d-393f38946680.png) 03 04

05 06 07 08

09 10 11 12 13 14 15

16 17

larrymie commented 3 years ago

STEP 1 — INSTALLING APACHE AND UPDATING THE FIREWALL

After creation of a new AWS account, I launched a new EC2 instance of t2.micro family with Ubuntu Server 20.04 LTS (HVM). As a Windows user, I used putty to connect to my EC2 Instance as found in the image below (01) below

01

The command was used to confirm apache was successfully installed as indicated below in image (02) 02

I opened my chrome browser and typed http://:80 to confirm my server is correctly installed and accessible through my firewall. the confirmation page can be found in image (3) below:

03

                                                                         STEP 2 — INSTALLING MYSQL

I installed a Database Management System (DBMS) to be able to store and manage data for my site in a relational database using the command

A security script that comes pre-installed with MySQL was runned using the command . This script removed some insecure default settings and lock down access to my database system. As image 4, 5 and 6 shows below: 04 05

06

I created a new strong password, Image 7 and 8 07 08

                                                               STEP 3 — INSTALLING PHP

PHP is the component of our setup that will process code to display dynamic content to the end user. I installed php-mysql and libapache2-mod-php with it simultaneously using the command sudo apt install php libapache2-mod-php php-mysql. image 9.

09

                                 STEP 4 — CREATING A VIRTUAL HOST FOR MY WEBSITE USING APACHE

I create a directory for projectlamp using ‘mkdir’ command as follows: <sudo mkdir /var/www/projectlamp> Next I assigned ownership of the directory with my current system user: <sudo chown -R $USER:$USER /var/www/projectlamp> I then used a command line editor to create and open a new configuration file in Apache using the command <sudo vi /etc/apache2/sites-available/projectlamp.conf> as seen in image (10) , (11) , (12) , (13) and (14) 10

11 ![12](https://user-images.githubusercontent.com/91284177/137747044-581a9383-b259-4b93-a979-519ddd27c92e.png 13 14

                                                STEP 5 — ENABLE PHP ON THE WEBSITE

I edited the behavior of the file, changed the order in which the index.php file is listed within the DirectoryIndex directive using the command: <sudo vim /etc/apache2/mods-enabled/dir.conf>

Pasted the below and saved it.

#Change this: #DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm #To this: DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

I reloaded the Apache for the changes to take effect; using

I created a PHP script to test that PHP is correctly installed and configured on my server.

Now that I have a custom location to host my website’s files and folders, I will create a PHP test script to confirm that Apache is able to handle and process requests for my PHP files.

Create a new file named index.php inside your custom web root folder:

vim /var/www/projectlamp/index.php This will open a blank file. Add the following text, which is valid PHP code, inside the file:

<?php phpinfo();

Image 15 and 16

15 16

Finally! I refreshed my chrome browser page and this was displayed: image 17 17

Image 17 confirmed that my PHP installation is working as expected.