Service type
Apache HTTP server service
Apache HTTP Server service for serving web content, with editable server and virtual host configuration.
This service runs your code: its image is built from a Git repository, and each build is deployed to an app environment.
On this page
Technical profile
Versions, source repository, and Helm chart.
Stacks that use it
Public stacks that include this service.
Source builds and CI/CD
Boilerplates, Git providers, CI, and container registries.
Service configuration
Config files and settings.
Services based on it
Catalog services that inherit from this one.
On Wodby
How Apache HTTP server runs on Wodby
.htaccess files.How it is configured
On every start the container renders its configuration from templates and environment variables: conf/httpd.conf, conf/conf.d/vhost.conf (one virtual host) and conf/preset.conf under /usr/local/apache2. They are rewritten on each start; never edit them in a running container.
To change the configuration:
- Set
APACHE_*environment variables on the service. - Change the
docrootsetting. - Override the main configuration template or the virtual host template, both declared as config files of this service.
- Add
.htaccessfiles to the codebase: overrides are allowed in the document root (APACHE_ALLOW_OVERRIDE_ENABLED), andmod_rewrite,mod_headers,mod_expiresandmod_deflateare loaded.
Preset
APACHE_VHOST_PRESET selects the rules included in the virtual host. This service uses the image default, html: files are served from the document root with index.html as the directory index (APACHE_DIRECTORY_INDEX). There is no fallback for paths that match no file; a single-page application needs its own rewrite rule in .htaccess. The image also ships a php preset, used by the PHP service built on this one.
Document root
The codebase is at /var/www/html. The docroot setting (variable DOCROOT_SUBDIR) names a subdirectory of the repository, and APACHE_DOCUMENT_ROOT is set to /var/www/html/ followed by it. Leave the setting empty to serve the repository root.
Always present
/.healthzreturns 204 and is not logged. Use it for health checks.- Files and directories whose names start with a dot are denied, as are files ending in
.sh,.sql,.mysql,.po,.tpl,.makeor.test,wodby.ymlandMakefile. - Directory listings are off unless
APACHE_INDEXES_ENABLEDis set.
Variables that matter most
| Variable | Effect |
|---|---|
APACHE_DIRECTORY_INDEX | directory index file |
APACHE_ALLOW_OVERRIDE_ENABLED | what .htaccess files may override |
APACHE_TIMEOUT, APACHE_REQUEST_READ_TIMEOUT | request time limits |
APACHE_LIMITED_ACCESS | removes the rule that grants access to everyone, so that access is defined elsewhere |
APACHE_HTTP2 | accepts cleartext HTTP/2 |
APACHE_INCLUDE_CONF | the files included in place of the generated virtual host |
APACHE_LOG_LEVEL | error log level |
Access and error logs go to the container's standard output and error.
Build and reaching the service
- The image is built from the connected repository: the codebase is copied into the image at
/var/www/html. Files are served from the built image, so a change needs a new build and deployment. - Other services reach it over HTTP on port 80 at the app service's name inside the environment.
Check the result
httpd -Sprints the virtual host in effect;httpd -tchecks the syntax.curl -sI localhost/.healthzreturns 204 from inside the container.
Overview
Technical profile of Apache HTTP server
Stacks
Stacks that include Apache HTTP server
CI/CD
Build Apache HTTP server from a Git repository
HTML boilerplate
Use it as it is, or clone it into your own Git account.
wodby/html-boilerplateGit providers
You connect a repository through an integration with its Git provider.
CI providers
Wodby CI is built in: the pipeline is the file .wodby/pipeline.yml in the repository. For a repository you connect, an external CI provider can run the same steps with Wodby CLI.
Container registries
Built images go to Wodby Registry by default, or to an external registry that you connect as an integration.
Environment variables from integrations
A variable integration stores the credentials of a third-party service once. Attach it to Apache HTTP server and Wodby passes them to the container as environment variables at runtime, not during the image build.
Configuration
Apache HTTP server service configuration
Technical domains
Configs
Settings
Based on this service