Skip to content

Apache

Apache

Introduction

Apache Web Server is a widely used and recognized software that serves as a common starting point for many when setting up a web server due to its ease of setup and extensive community support. This content bundle leverages the familiarity of Apache to help users learn about the RackN DRP platform. By demonstrating multiple methods to accomplish tasks using Apache, users can gain a better understanding of how to utilize the DRP platform effectively.

Technical Requirements

  • Digital Rebar Provision environment
  • Network access to package repositories
  • Supported operating systems (any OS with install-os-pkg-map support)
  • Root/sudo access for installation

Prerequisites

The following content bundles must be available in your DRP environment: - drp-community-content (version >=4.16.0) - universal (version >=4.13.0)

The DRP server must support the jsonobject-compose-support feature.

Architecture

The Apache content bundle consists of several key components that work together:

  1. Parameters
  2. apache/packages: Maps package names across platforms (via install-os-pkg-map)
  3. apache/index-template: Template name for the default index page
  4. apache/render-index: Boolean toggle for index page placement (default: true)
  5. apache/vhosts: List of virtual host configurations (default: empty)

  6. Tasks

  7. apache-install: Installs Apache package, configures firewall, starts service
  8. apache-configure: Places index page and optional vhosts drop-in config
  9. apache-uninstall: Stops service, removes packages, cleans up firewall and config
  10. apache-remove-profile: Removes all Apache profiles from the machine

  11. Profiles

  12. apache-web-server: Basic profile for single-server deployment
  13. universal-application-apache-web-server: Complete pipeline for infrastructure deployment
  14. apache-uninstall: Uninstall profile (wires uninstall + profile removal into flexiflow)

  15. Blueprints

  16. apache-install: Wraps the install task
  17. apache-configure: Wraps the configure task
  18. apache-uninstall: Wraps uninstall + profile removal tasks

Installation

To install the apache content bundle, use the following commands:

Bash
git clone https://gitlab.com/rackn/content/apache
cd apache
drpcli contents bundle apache.yaml --src-dir content
drpcli contents upload apache.yaml

Execution

There are two methods for executing this content bundle:

Method 1: Profile Assignment

Use this method for single server deployments:

Bash
# Assign the profile to a machine
drpcli machines addprofile "machine-uuid" "apache-web-server"

# Execute the universal-runbook workflow
drpcli machines workflow "machine-uuid" "universal-runbook"

Method 2: Universal Application Pipeline

Use this method for cluster deployments:

Bash
# Assign the pipeline profile
drpcli machines addprofile "machine-uuid" "universal-application-apache-web-server"

# Execute the workflow
drpcli machines workflow "machine-uuid" "universal-linux-install"
drpcli machines update "machine-uuid" '{"Runnable": true}'

Choosing an Option

1) Profile Assignment: Ideal for single-machine deployments, testing, or development environments.

2) Universal Application Pipeline: Best suited for production environments where you need to deploy multiple Apache nodes as part of a larger infrastructure.

Uninstall

To uninstall Apache from a machine:

Bash
# Add the uninstall profile (must be last in the profile list)
drpcli machines addprofile "machine-uuid" "apache-uninstall"

# Re-run the workflow
drpcli machines workflow "machine-uuid" ""
drpcli machines workflow "machine-uuid" "universal-runbook"
drpcli machines update "machine-uuid" '{"Runnable": true}'

The uninstall profile will stop the service, remove packages, clean up firewall rules and configuration, then remove all Apache profiles from the machine.

Virtual Hosts

To configure custom virtual hosts, set the apache/vhosts parameter:

YAML
apache/vhosts:
  - server_name: example.com
    document_root: /var/www/example
  - server_name: api.example.com
    port: "8080"
    document_root: /var/www/api

The vhosts config is placed in the OS-appropriate drop-in directory (/etc/httpd/conf.d/ on RHEL, /etc/apache2/sites-enabled/ on Debian). When the list is empty (the default), no config file is placed.

To disable the default index page, set apache/render-index to false.

Troubleshooting

Common issues and solutions:

  1. Package Installation Failures
  2. Verify network connectivity to package repositories
  3. Check install-os-pkg-map has an apache2 entry for your OS

  4. Firewall Configuration

  5. Verify port 80 is open using iptables -L
  6. Ensure firewall rules are persisted

  7. Apache Service Issues

  8. Check service status with the OS-appropriate service name (httpd on RHEL, apache2 on Debian)
  9. Review logs in /var/log/httpd/ or /var/log/apache2/

Talk to Us!

The RackN Team uses Slack to communicate with our Digital Rebar Provision community. If you haven't already signed up for our Community Slack, you can do so at:

  • https://rackn.com/support/for-community/

We look forward to helping you with your provisioning automation journey towards a fully self sustained Continuously Delivered Data Center journey.