- Lab
- A Cloud Guru
Compiling Software from Source in SUSE Linux Enterprise
In this hands-on lab, we will be compiling software from source code and then deploying and testing that software.
Path Info
Table of Contents
-
Challenge
Install the GNU Compiler, Retrieve the Nginx Source Files Package, and Extract It
-
Install the GNU compiler:
sudo -i zypper in -y gcc
-
From your
home
directory, download the Nginx package:wget https://nginx.org/download/nginx-1.16.1.tar.gz
-
Extract the package, and switch to its directory:
tar zxf nginx-1.16.1.tar.gz cd nginx-1.16.1
-
-
Challenge
Once Inside the Package Directory, Configure the Make File, and Run the Compile and Install Commands
-
Run the
configure
command and read the output:./configure
-
Correct the issue using the
--without
directive:./configure --without-http_rewrite_module
-
Continue until your configure runs with no issues:
./configure --without-http_rewrite_module --without-http_gzip_module
-
Once this has completed, run the compile and install commands:
make sudo make install
-
-
Challenge
Run Nginx and Ensure It Loads, and Then Stop Nginx
-
Start Nginx:
sudo /usr/local/nginx/sbin/nginx
-
Make sure it is working by loading the index page:
curl 127.0.0.1
-
Locate the master process ID:
ps -ax | grep nginx
Copy the ID of the master process.
-
Stop Nginx:
sudo kill <MASTER_PROCESS_ID>
-
Verify Nginx is not running:
ps -ax | grep nginx
It should return only the
grep
command.
-
-
Challenge
Create a `websrv` Directory, Reconfigure Nginx to Install to That Directory, and Make and Install It to the `websrv` Directory
-
Ensure you are in the Nginx source directory:
cd ~/nginx-1.16.1
-
Clean up the
make
environment:make clean
-
Configure the makefile:
./configure --prefix=/home/cloud_user/websrv --without-http_rewrite_module --without-http_gzip_module
-
Make the software and install it:
make sudo make install
-
-
Challenge
Run and Verify That Nginx Is Working from the `websrv` Directory
-
Start the Nginx you just installed:
cd ~/websrv/sbin sudo ./nginx
-
Verify it is working:
curl 127.0.0.1
-
Locate the master process ID:
ps -ax | grep nginx
-
Stop the process:
sudo kill <MASTER_PROCESS_ID>
-
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.