Skip to main content

Managing Software via RPM in SUSE Linux Enterprise

Hands-On Lab

 

Photo of Ross Brunson

Ross Brunson

Linux Training Architect II

Length

00:30:00

Difficulty

Beginner

In this hands-on lab, we will be using the RPM command to manage our software installations. This may be something you are tasked with to show your proficiency with software management tools.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Managing Software via RPM in SUSE Linux Enterprise

Introduction

In this hands-on lab, we will be using the RPM command to manage our software installations. This may be something you are tasked with to show your proficiency with software management tools.

Solution

Log in to the Server1 server using the credentials provided:

ssh cloud_user@<SERVER1_PUBLIC_IP_ADDRESS>

Using a File from the Packages List, Get the Package Version for the Apache2 Installation

  1. Get a list of the Apache2 files:

    rpm -ql apache2
  2. Determine the package version for the installation:

    rpm -qf /var/lib/apache2

In the default-server.conf, Modify the Document Root

  1. List the configuration files to locate the default-server.conf:

    rpm -qc apache2
  2. Open the default-server.conf configuration file:

    sudo vim /etc/apache2/default-server.conf

    Enter the cloud_user password at the prompt.

  3. In the section toward the top dealing with document root, change the following lines:

    DocumentRoot "/srv/www/htdocs"
    <Directory "/srv/www/htdocs">

    To this:

    DocumentRoot "/var/www/htdocs"
    <Directory "/var/www/htdocs"> 

    Save and quit the file by hitting Esc and then Shift+ZZ.

Use Rsync to Copy the Old Doc Root to the New Doc Root and Create an index File Containing the string new doc root

  1. Synchronize the doc root:

    sudo rsync -avr /srv/www /var
  2. Change to the directory:

    cd /var/www/htdocs/
  3. Create an index.html file in the new doc root:

    sudo touch index.html
  4. Open the file:

    sudo vim index.html
  5. Add the following to the file:

    new doc root

    Save and exit the file by hitting Esc and then Shift+ZZ.

Verify the Package Files and Ensure the server-default.conf is Listed as Changed. Start Apache2 and Ensure the New index Loads.

  1. Verify the package files and ensure the server-default.conf was successfully changed:

    rpm -V apache2

    It should tell us the default-server.conf file was changed.

  2. Start Apache2:

    sudo systemctl start apache2
  3. Check the index:

    curl 127.0.0.1

    The result should be the string inserted in the previous task.

Conclusion

Congratulations on successfully completing this hands-on lab!