Overview
This template provides a production‑ready Apache HTTP Server instance as a Monk runnable. You can:- Run it directly to get a managed Apache web server with sensible defaults
- Inherit it in your own runnable to seamlessly add a web server to your stack
What this template manages
- Apache HTTP Server container (
httpdimage, configurable tag) - Network service on configurable ports (default HTTP: 80, HTTPS: 443)
- Custom Apache configuration files
- Virtual host configurations
- Volume mounts for static content and logs
Quick start (run directly)
- Load templates
- Run Apache with defaults
- Customize configuration (recommended via inheritance)
variables. For production use with custom configurations:
- Preferred: inherit and customize variables as shown below.
- Alternative: fork/clone and edit the
variablesinapache.yml, thenmonk load MANIFESTand run.
http://localhost:8080 (or the configured port).
Configuration
Key variables you can customize in this template:/files directory:
httpd.conf- Main Apache configurationvhost.conf- Virtual host configuration
Use by inheritance (recommended for apps)
Inherit the Apache runnable in your application to serve static content or proxy to backend services. Example:Ports and connectivity
- Service:
apacheon TCP ports80(HTTP) and443(HTTPS) by default - Configurable via
http-portandhttps-portvariables - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve the web server host.
Persistence and configuration
- Config files: Mount custom configurations from the
files/directory - Logs: Container logs accessible via
monk logscommand - Static content: Mount your web root directory as needed in inherited runnables
- You can override any Apache configuration by providing custom
.conffiles
Features
- Static file serving with high performance
- Reverse proxy capabilities with mod_proxy
- SSL/TLS support (mod_ssl)
- URL rewriting (mod_rewrite)
- Load balancing across multiple backends
- Virtual hosts for multi-site hosting
- Security modules (mod_security compatible)
Related templates
- Combine with application backends (Node.js, Python, PHP, Go)
- Use
certbot/ortraefik/for automated SSL/TLS certificates - Integrate with
prometheus-grafana/for monitoring and metrics - Pair with
redis/ormemcached/for caching
Troubleshooting
- If configuration changes don’t take effect, ensure the container has restarted after updating config files.
- For SSL/TLS issues, verify certificate paths and permissions.
- Check logs for detailed error messages:
- To test configuration syntax before running: