The HTTPD Tanzu Buildpack supports the installation and running of the Apache HTTP Server.
NOTE: The Full stack is required because HTTPD relies on operating system libraries only present in the Full stack.
The HTTPD CNB (Cloud Native Buildpack) allows you to specify a version of the Apache HTTP Server to use during deployment. This version can be specified through the
BP_HTTPD_VERSION environment variable. When specifying a version of the Apache HTTP Server, you must choose a version that is available within the buildpack.
Specifying a version of
httpd is not required. In the case that it is not specified, the buildpack will provide a default version.
For e.g. to configure the buildpack to use HTTPD
v2.4.46 when deploying your app, set the following environment variable at build time, either directly (e.g.
pack build my-app --env BP_HTTPD_VERSION=2.4.*) or through a project.toml file:
The Apache HTTPD Server Buildpack supports building static applications that do not include an
httpd.conf. When the
BP_WEB_SERVER environment variable is set to
httpd, the buildpack will generate an
http.conf during the build process.
It is possible to configure the generated
httpd.conf in several ways. Each option is configurable with an environment variable or service binding, as seen below.
BP_WEB_SERVER_ROOT variable allows you to modify the location of the static files served by the web server. Set the
BP_WEB_SERVER_ROOT variable to an absolute file path or a file path relative to
/workspace. For example, setting
BP_WEB_SERVER_ROOT=my-build-directory changes the file path of served files to
BP_WEB_SERVER_ENABLE_PUSH_STATE variable enables push state routing functionality. This is useful for single-page web applications.
BP_WEB_SERVER_FORCE_HTTPS variable enables enforcing HTTPS for server connections. HTTP requests will be redirected to the corresponding HTTPS endpoint.
You are able to provide basic authentication credentials via a service bindings of type
htpasswd that specifies the contents of a
.htpasswd file. The service binding should have the following directory structure:
binding └── type └── .htpasswd
httpd.conf file in your application's source code or set
BP_WEB_SERVER=httpd in the build environment to automatically generate one. The HTTPD buildpack will install the Apache HTTP Server binary and configure it to start when the app image launches.
When the HTTPD Buildpack participates in a build, it will contribute in one of three ways:
httpd.conf file is present in your app's source code, the buildpack will set up an Apache HTTP server with that config.
httpd.conf is not present in the app's source code, the buildpack simply provides the Apache HTTP Server dependency to subsequent buildpacks without actually setting up a server.
BP_WEB_SERVER is set to
httpd, the buildpack will set up an Apache HTTP server with a default configuration.
Enables reloadable processes.
Allows you to specify the version of Apache HTTP Server that is installed.
When the value is set to
httpd the buildpack will generate a default
public, setting this allows you to modify the location of the static files served by the web server with either an absolute file path or a file path relative to
Enables push state routing functionality.
Allows you to enforce HTTPS for server connections by redirecting all requests to use the HTTPS protocol.
The HTTPD buildpack can be configured using service bindings.
||Required Files||# Bindings of This Type Accepted|
||0 or 1|