Pivotal Knowledge Base

Follow

How to Customize Java Build packs Tomcat's Server.xml

Environment 

 Product  Version
 Pivotal Cloud Foundry  1.7, 1.8
 Tomcat  7.x, 8.x

Overview

This article provides 2 ways by which you can provide your customized server.xml to Tomcat that will run in Pivotal Cloud Foundry.

Description

Option 1: Forking the Java build pack

1. Create a custom build pack based on Java build pack.

2. Edit Java build pack's server.xml, specifically this file:

https://github.com/cloudfoundry/java-buildpack/blob/master/resources/tomcat/conf/server.xml

3. cf push your application using your custom build pack. 

Option 2: Using an external server.xml 

1. Create an artifact in a repository in TAR format and must follow the Tomcat archive structure:

tomcat
|__conf
|__context.xml
|__server.xml
|__web.xml
|...

2. Edit your application's manifest.yml and specify the following environment variable:

env:
JBP_CONFIG_TOMCAT: "{ tomcat: { external_configuration_enabled: true }, external_configuration: { repository_root: \"http://repository...\" } }"

3. cf push your application.

Additional Information

Java Buildpack's Tomcat Container 

  

Comments

Powered by Zendesk