RHCE 8 - Deploy Apache Web Server

Опубликовано: 02 Сентябрь 2019
на канале: 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


На этой странице сайта вы можете посмотреть видео онлайн RHCE 8 - Deploy Apache Web Server длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь theurbanpenguin 02 Сентябрь 2019, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 6,372 раз и оно понравилось 145 зрителям. Приятного просмотра!