Compile a Program from Source

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Building programs from source has many uses. Among these are installing software that is not in a package manager, installing brand new or older releases, and modifying the source code prior to installation to meet a particular need. This hands-on lab is designed to test you on installing programs from source code. In order to complete this lab, you need to obtain the source and extract it in the proper location. Then, you can use the program-specific `configure` script to create a Makefile. Finally, you need to compile source code and install it to the correct location.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Download and Extract the Source Files to /usr/local/src

Change directories to /usr/local/src and download the source files with wget using the URLs provided:

Then, extract the source files to /usr/local/src.

Install nginx to /usr/local

Change directories to the top level directory for nginx-1.19.6. Then, run the configure script to create the Makefile based on the instructions provided (resolve any dependencies).

  • The install location should be /usr/local/nginx.
  • The rewrite and gzip modules should be excluded.

Compile the program, install the program, and validate the installation by starting the service.

  • The nginx service can be started by issuing ./nginx from the sbin directory within the install.
  • The nginx service can be stopped by issuing ./nginx -s stop from the sbin directory.
  • Ensure the service is shut down before proceeding to the next step.
Install apache httpd to /opt

Change directories to the top level directory for httpd-2.2.9. Then, run the configure script to create the Makefile.

  • The install location should be /opt/httpd-2.2.9.

Compile the program, install the program, and validate the installation by starting the service.

  • The service can be started by issuing ./apachectl -k start from the bin directory within the install.

Additional Resources

You work as a System Administrator for a mid-sized company that has decided to begin hosting their own web servers. As part of this initiative, you have been tasked with setting up a system with the two web servers that are under consideration: nginx and httpd. In order to complete this task, you will need to obtain the source code tarballs and extract them in /usr/local/src. Once extracted, you will need to install nginx to /usr/local/nginx, being sure to exclude the rewrite and gzip modules. Be sure that nginx is functioning properly before installing and testing the httpd server. Then, you will need to install httpd to /opt/httpd-2.2.9 and ensure that is working as expected.

Notes:

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.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!

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