Downloading and Configuring Web Application Frontend

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

The objective of this lab will be to download and configure the frontend for our application. You will first need to download the code of the frontend from GitHub. After that, you will unpack it, move it to the correct directory, and configure the proper SELinux context for the newly downloaded files, so that they can be properly accessed from the outside world without any problems. This is a common security practice with the Apache web server. If this is not done, the files can become inaccessible, and a portion of your site will be non-functional.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Download the Code
  1. Download the compressed files from GitHub (URL: https://github.com/ErminLA/HardeningApache/archive/master.zip).

  2. Unpack the compressed files.

Move and Rename the Files
  1. Move the unpacked file index.html to the web server /var/www/html.

  2. Move and rename the unpacked file Linux Full Logo-01.png to LA_Logo.png.

Configure SELinux
  1. Configure and apply SELinux Context for the index.html file.

  2. Configure and apply SELinux Context for the .png file.

Test the Application Frontend

Test if the application frontend works by opening a private or incognito window in your web browser and using the provided server instance public IP address http://www.<Server_Public_IP>.

Additional Resources

As a future DevOps, you will often be required to deploy applications that developers have created. Sometimes, you need to deploy an application in its entirety; sometimes, it is a partial deployment. In this lab, we will pull the frontend of the application from GitHub and deploy it. We will achieve this by downloading the files from GitHub and moving those files to their proper directories. In this case, there are a few files that need to be moved into the current DocumentRoot of the web server, while other files need to be renamed. For example, index.html only needs to be moved, but the .png file will need to be renamed to La_Logo.png.

However, simply moving the files is not enough, as security mechanisms can prevent access to these files unless they are informed beforehand that access needs to be granted. In addition to renaming and moving files, we will also configure the SELinux context of all new files in the DocumentRoot.

Once all is said and done, if we can access the application via our web browser with the server's public IP address and it loads the application without any errors, we have successfully deployed the frontend of the application.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?