RHCE 8 - Deploy Apache Web Server

Publicado el: 02 septiembre 2019
en el canal de: theurbanpenguin
6,372
145

Looking at deploying the web server on RHEL 8 it is more than just installed the httpd package. Se need to to install httpd-manual for documentation and we may need to install firewalld if we want to protect the system. We also will need to configure the web server, even if it to listen just on IPv4. We will need web content before starting the services and enabling the port in the firewall. More than you at first think. This is where Ansible comes and why RH294 and the EX294 exam now are part of your RHCE certification. This practical demonstration of Ansible shows how to install multiple yum packages and how to use loops to start services. We also use variable from Ansible facts to set the List address on each web server.
---
name: Deploy Apache
hosts: redhat
gather_facts: true
tasks:

name: Install Apache
yum:
name:
httpd
httpd-manual
firewalld
state: latest

name: Don't Listen All Interfaces
lineinfile:
path: /etc/httpd/conf/httpd.conf
regexp: '^Listen 80'
state: absent

name: Listen Single Interface
lineinfile:
path: /etc/httpd/conf/httpd.conf
insertafter: '^#Listen'
line: 'Listen {{ ansible_default_ipv4.address }}:80'

name: Default Page
copy:
dest: /var/www/html/index.html
content: |
Welcome to my page
This is from devops

name: Start Services
service:
name: "{{ item }}"
state: started
enabled: true
loop:
httpd
firewalld

name: Open Firewall
firewalld:
service: http
state: enabled
permanent: true
immediate: true
...

Additionally you can find my video courses on Pluralsight: http://pluralsight.com/training/Autho... and take time to see my own site http://www.theurbanpenguin.com


En esta página del sitio puede ver el video en línea RHCE 8 - Deploy Apache Web Server de Duración hora minuto segunda en buena calidad , que subió el usuario theurbanpenguin 02 septiembre 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 6,372 veces y le gustó 145 a los espectadores. Disfruta viendo!