Bug 56489 - Include a directory for configuration files
Summary: Include a directory for configuration files
Status: NEW
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: mod_jk (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement with 10 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-05 12:56 UTC by Frank
Modified: 2019-06-16 14:45 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank 2014-05-05 12:56:57 UTC
I would like to split workers.properties into different smaller files.
For this instead of 
"JkWorkersFile = /path/to/workers.properties" an option like 
"JkWorkersDir = /path/to/dir/*.conf" would be needed.

In this example, every file in that directory that ends in ".conf" should be loaded in alphabetical or numerical order.

Files could look like this:
00-templates.conf:
worker.tpl.method=Busyness
worker.tpl.sticky_session=True
worker.tpl.recover_time=20
worker.tpl.type=ajp13
worker.tpl.lbfactor=2
worker.tpl.fail_on_status=500,503
worker.tpl.socket_timeout=0
worker.tpl.connect_timeout=50000

01-host1.mydomain.tld:
worker.host1.reference=worker.tpl
worker.host1.host=host1.mydomain.tld
worker.host1.port=8009
worker.host1.route=host1

02-www.mydomain.tld:
worker.list=www.mydomain.tld
worker.www.mydomain.tld.type=lb
worker.www.mydomain.tld.balance_workers=host1.mydomain.tld

and so on. I think you'll get it.

Reasons for this are:
1) workers.properties gets really big and confusing. Our production config's got 750 lines right now, and it keeps growing.
Splitting it in smaller files by e.g. domain would be a huge improvement in terms of complexity.
2) With configuration management tools (e.g. puppet) it's way more easier to handle seperate files than a single big one. Goal is to auto create all the stuff.
Comment 1 Rainer Jung 2015-01-05 11:17:21 UTC
Note that you can work around this issue by using the JkWorkerProperty syntax inside httpd.conf instead of using workers.properties. See for JkWorkerProperty in http://tomcat.apache.org/connectors-doc/reference/apache.html.

Example:

JkWorkerProperty worker.list=myworker
JkWorkerProperty worker.myworker.type=ajp13
JkWorkerProperty worker.myworker.host=localhost
JkWorkerProperty worker.myworker.port=8009
...

Apache allows to split up config files into modular pieces and paste them together using the "Include" directive with various wildcard possibilities. With that approach you can also mix the "reference" feature of the mod_jk properties and e.g. mod_macro to simplify config files.

It could make sense to support your original enhancement request, but currently I don't plan to work on it.