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-mapsupport) - 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:
- Parameters
apache/packages: Maps package names across platforms (viainstall-os-pkg-map)apache/index-template: Template name for the default index pageapache/render-index: Boolean toggle for index page placement (default: true)-
apache/vhosts: List of virtual host configurations (default: empty) -
Tasks
apache-install: Installs Apache package, configures firewall, starts serviceapache-configure: Places index page and optional vhosts drop-in configapache-uninstall: Stops service, removes packages, cleans up firewall and config-
apache-remove-profile: Removes all Apache profiles from the machine -
Profiles
apache-web-server: Basic profile for single-server deploymentuniversal-application-apache-web-server: Complete pipeline for infrastructure deployment-
apache-uninstall: Uninstall profile (wires uninstall + profile removal into flexiflow) -
Blueprints
apache-install: Wraps the install taskapache-configure: Wraps the configure taskapache-uninstall: Wraps uninstall + profile removal tasks
Installation¶
To install the apache content bundle, use the following commands:
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:
# 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:
# 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:
# 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:
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:
- Package Installation Failures
- Verify network connectivity to package repositories
-
Check
install-os-pkg-maphas anapache2entry for your OS -
Firewall Configuration
- Verify port 80 is open using
iptables -L -
Ensure firewall rules are persisted
-
Apache Service Issues
- Check service status with the OS-appropriate service name (
httpdon RHEL,apache2on Debian) - 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.