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

Waiting till 8:01 AM
Writing 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
Like this:
Like Loading...