Can system properties be used to define alias values for virtual servers in EAP 6s web subsystem?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6.x
Issue
-
We are configuring a virtual server in the web subsystem; can we define the aliases for this virtual host with a system property, for example:
<virtual-server name="customvirtualserver"> <alias name="${vhost.name}"/> </virtual-server> -
Is it possible set alias attribute in Web sysbsyetm value dynmaically using system property? As following so that the URL responds with the short name and the long name will be get handled (for example
http://myapp/app1andhttp://myapp.mydomain.com/app1).
<alias name="${myapp.mydomain}"/>
Resolution
- This parameter does not currently support system property expressions. We can confirm this via CLI as described in How to verify whether a JBoss EAP 6 subsystem supports system property / expressions replacement (note expressions-allowed is false):
/subsystem=web/virtual-server=default-host:read-resource-description
...
"alias" => {
"type" => LIST,
"description" => "The virtual server aliases",
"expressions-allowed" => false,
"nillable" => true,
"value-type" => STRING,
"access-type" => "read-write",
"storage" => "configuration",
"restart-required" => "resource-services"
},
...
- BZ-1045183 has been filed as a enhancement request to have property expression support added to the alias attribute, but there will no longer be an opportunity for this to be added to EAP 6 as 6.4.0 was the last minor release.
- But it looks like upstream widlfly does support system property expressions for host aliases. So this will likely be inherited in a future EAP release, such as EAP 7.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
