Lab 1: Web Server Setup

Beginner 30 minutes Beginner Labs

Learning Objectives

  • Install and configure Apache web server
  • Deploy a simple HTML website
  • Manage the web server service
  • Use Ansible modules: apt/yum, copy, service

Progress

0 of 3 tasks completed

Tasks

1
Install Apache
Use the appropriate package module to install Apache. For Ubuntu/Debian use "apache2", for RHEL/CentOS use "httpd".
2
Create index.html
Create a simple index.html file with a welcome message and copy it to /var/www/html/
3
Start Apache Service
Ensure the Apache service is running and enabled on boot
Hints for Task
    Playbook
    Inventory
    --- - name: Web Server Setup Lab hosts: localhost become: yes tasks: # Task 1: Install Apache # Add your code here # Task 2: Create index.html # Add your code here # Task 3: Start Apache service # Add your code here
    localhost ansible_connection=local
    Output
    Waiting for playbook execution...