mariuszczyz.centos_apache

CentOS 7/8 & Fedora Apache Server Installation and Configuration Role

This guide describes how to easily install and set up a basic Apache web server on CentOS and Fedora.

Currently, the only customization available is some simple performance improvements for servers with low resources.

KeepAlive Off

<IfModule prefork.c>
    StartServers        4
    MinSpareServers     20
    MaxSpareServers     40
    MaxClients          200
    MaxRequestsPerChild 4500
</IfModule>

Requirements

No special requirements.

Role Variables

You can customize the following role variables in one of these locations:

Recommended:

  • host_vars/{{ HOSTNAME }}.yml
  • group_vars/{{ GROUPNAME }}.yml

Optional:

  • {{ roles_path }}/mariuszczyz.centos_apache/defaults/main.yml

Make sure to replace {{ HOSTNAME }} and {{ GROUPNAME }} with the relevant names from your inventory.

It’s best to place all necessary variables in host_vars and group_vars to prevent them from being overwritten in future updates.

Variable Description Example
START_SERVERS Initial number of threads when the server restarts 4
MIN_SPARE_SERVERS Number of threads to keep ready for use 20
MAX_SPARE_SERVERS Maximum number of threads to keep ready during high traffic 40
MAX_CLIENTS Maximum number of connections the server will accept 200
MAX_REQUEST_PER_CHILD Maximum requests each thread can handle before it stops 4500

Dependencies

No dependencies.

Example Playbook

Manual Installation

To fetch this role from Ansible Galaxy manually, you can use:

ansible-galaxy install mariuszczyz.centos_apache

Automatic Installation

From Galaxy

To include this role from Ansible Galaxy using requirements.yml, add the following:

# requirements.yml
# Install from Ansible Galaxy
- src: mariuszczyz.centos_apache

From GitHub

You can also install from a GitHub repository like so:

# requirements.yml
# Install from GitHub repository
- src: https://www.github.com/mariuszczyz/centos_apache

Then run this command to install all dependencies from Ansible Galaxy:

ansible-galaxy install -r requirements.yml

Run it

To run this role individually, create a new file named playbook.yml with the following content:

- hosts: servers
  user: YOUR USER
  become: True

  roles:
    - { role: mariuszczyz.centos_apache, tags: ['centos_apache'] }

You can then run it using the command:

ansible-playbook -i hosts playbook.yml

License

This project is licensed under the BSD License.

Author Information

Author: Mariusz Czyz
Date: 12/2019
Website: mariuszczyz.com

Informazioni sul progetto

CentOS 7/8 and Fedora Apache Server Installation and Configuration Role

Installa
ansible-galaxy install mariuszczyz.centos_apache
Licenza
Unknown
Download
436
Proprietario