Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
    • Security
Google Cloud Platform icon
Labs

Working with OpenSSL and Httpd

Approximately 25% of the LPIC-3 Security exam is based on cryptography and how to employ it in Linux. In this hands-on lab, we will learn how to generate a signed certificate using `openssl` and use that certificate to secure HTTP traffic. We will then use the `openssl` command to verify the Apache configuration.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Advanced
Last updated
Sep 23, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Install `mod_ssl` on the host `webserver`.

    Run yum install mod_ssl, and accept the prompts.

  2. Challenge

    Generate and sign the private key for `shop.example.com` using `openssl`.
    1. Create a new encrypted private key.
    openssl genrsa -aes128 -out /etc/pki/tls/private/httpdkey.pem
    
    1. Enter httpd at the passphrase prompt.
    2. Generate a self-signed certificate using the key.
    openssl req -new -x509 -key /etc/pki/tls/private/httpdkey.pem -out /etc/pki/tls/certs/httpdcert.pem -days 365
    
    1. Enter httpd at the passphrase prompt.
    2. At the prompts, enter the field information provided in the instructions (use defaults where not specified).
  3. Challenge

    Update the default Apache virtual host to accept connections on `shop.example.com` using the new keypair, and allow HTTPS traffic through the firewall.
    1. Make the following changes to /etc/httpd/conf.d/ssl.conf:

      • At the end of the <VirtualHost _default_:443> section, add the following on a new line:
        • ServerName shop.example.com:443
      • Locate the line SSLCertificateFile /etc/pki/tls/certs/localhost.crt, and change it to the following:
        • SSLCertificateFile /etc/pki/tls/certs/httpdcert.pem
      • Locate the line SSLCertificateKeyFile /etc/pki/tls/private/localhost.key, and change it to the following:
        • SSLCertificateKeyFile /etc/pki/tls/private/httpdkey.pem
    2. Restart httpd to put the changes into effect.

    systemctl restart httpd
    
    1. Enter httpd at the passphrase prompt.
    2. Open port 443 on the OS firewall.
    sudo firewall-cmd --add-service=https --permanent 
    sudo firewall-cmd --reload
    
  4. Challenge

    Verify the configuration with `openssl` from the host `workstation`.
    1. On the workstation machine, run the following command:
    openssl s_client -connect shop.example.com:443 > /home/cloud_user/httpd_output
    
    **Note:** The OpenSSL `s_client` will briefly wait for input before terminating the connection. You may either interrupt the running command or let it close automatically. No further input is required.
    
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

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.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight