DevOps Classroom notes 06/Mar/2025

Website deployment: Lets deploy the website into apache

  • Lets download the sample template of website from here
  • Manual steps:
    • Ensure apache server is installed and running
    • dowload the zip file and unzip, copy the folder into /var/www/html folder
  • Commands
sudo apt update
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2
cd /tmp
wget https://www.free-css.com/assets/files/free-css-templates/download/page291/goind.zip
sudo apt install unzip -y
unzip goind.zip
sudo mv /tmp/html /var/www/html/naukri
sudo systemctl restart apache2
  • Navigate to http://<ip>/naukri
    Preview

Waiting till 8:01 AM

Writing playbook

  • Playbook
---
- name: deploy website into apache webserver
  hosts: all
  become: yes
  tasks:
    - name: install apache2
      ansible.builtin.apt:
        name: apache2
        update_cache: yes
        state: present
    - name: enable and ensure apache is started
      ansible.builtin.systemd_service:
        name: apache2
        enabled: yes
        state: started
    - name: ensure unzip is installed
      ansible.builtin.apt:
        name: unzip
        state: present
    - name: download and extract website
      ansible.builtin.unarchive:
        src: https://www.free-css.com/assets/files/free-css-templates/download/page291/goind.zip
        dest: /tmp
        remote_src: yes
    - name: copy the html folder to naukri
      ansible.builtin.copy:
        src: /tmp/html/
        dest: /var/www/html/naukri
        remote_src: yes

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube