course
Lab Activity

Setup Apache and Open Firewall Port using Ansible

Learn how to install the Apache web server on remote hosts and configure the firewall to open port 80 for HTTP traffic using Ansible, automating the entire process.

Through this lab, you will learn to automate the deployment of an Apache web server and configure firewall rules using Ansible playbook. You will create and run Ansible playbooks for installing and configuring software on remote hosts, manage firewall settings with firewalld, and perform essential verification tasks. This lab offers hands-on experience in managing remote hosts efficiently and securely using automation tools.

Learning Outcomes

By the end of this lab, you will be able to:

  • Write and execute Ansible playbooks for installing and managing software.

  • Configure and start essential services such as Apache and firewalld.

  • Automate firewall port management using Ansible collections.

  • Verify service status and firewall configurations on remote hosts.

Key Concepts

  • Apache Web Server

    • One of the most widely used web servers, providing a reliable way to serve websites and web applications.

    • Installation and Management: In this lab, you'll automate its deployment and configuration using Ansible. This removes the need for manual setup, ensuring consistency and reducing the chance of errors.

    • HTTP Traffic: Apache listens on port 80 by default, making it essential to configure the firewall for seamless access.

  • firewalld Service

    • firewalld is a dynamic firewall manager for Linux systems that offers a powerful way to define and manage network zones and policies.

    • In this lab, we will focus on opening port 80 to allow HTTP traffic. The dynamic nature of firewalld makes it easier to adjust firewall rules without disrupting services.

  • Ansible Galaxy Collections

    • Ansible Galaxy is a repository for pre-built roles and collections. Collections, such as ansible.posix, bundle multiple modules and plugins for specific system management tasks.

    • The ansible.posix collection simplifies managing POSIX-compliant systems by providing tools to configure firewalls and other system components efficiently.

  • Secure Copy Protocol (scp)

    • A command-line tool to transfer files securely between hosts.

Why This Lab is Needed

  • Simplifies complex system configurations, reducing time spent on repetitive tasks.

  • Ensures all servers are configured uniformly, eliminating configuration drift.

  • Centralises the management of services and firewall rules, enhancing security and scalability.

  • Prepares you for professional scenarios by leveraging tools like Ansible and firewalld to streamline system management.

  • Automating firewall configurations ensures critical services like Apache are protected by precise and reliable security rules.

© RHCSA GURU, Singapore