Advanced Webtier customizations
Myst has out of the box support for customising webtier routing rules and standard settings as described here. This approach takes the inputs from attributes defined in the MyST Platform Definition and uses these to generate the moduleconf\*.conf
files and httpd.conf
, admin.conf
and sshd.conf
. But what if you want full control over the files being created?
In this case, you may find it more fitting to define a template file for replacement when the webtier is configured at provision-time.
Myst Webtier Template - A working example
Let's say for instance, that you wanted to create a file called moduleconf/custom.conf
with the following:
Whilst the above could be achieved entirely through the Routing Rules construct in the MyST Platform Definition, it may be easier to use a template. Let's look at the templated version of our custom.conf
.
Notice that we have replaced osb_domain
with ${core.domain.name}
so that it takes the value from the Platform Model. Similarly, we have replaced osb02.acme:9011,osb02.acme:9011
with ${core.domain.cluster[osb].cluster-address}
. This ensures that the template can be reusable across multiple Platform Instances.
Registering the Webtier Template in Myst Studio
We can register our template:
Click Administration > Custom Actions > Create New
Name:
webtier-custom-router
but this can be anything you wantResource Type:
Plain text
Target Location:
ohs/custom.conf
which we will provide this value to our Platform Blueprint later ![](/assets/Screenshot 2017-08-07 11.29.05.png)Click Save.
NOTE: Oracle Webtier will dynamically discover any files under moduleconf
with this extension and Myst will copy any files to moduleconf
that exist in the source directory.
Updating the Platform Blueprint to use the Webtier Template
Go to the Platform Blueprint > Webtier Configuration.
Moduleconf Source Directory:
${myst.workspace}/resources/custom/ohs
Save and Commit
During a provision, the custom webtier routing rules will be taken from the Webtier template
To apply the changes without doing a reprovision:
Run
configure-webtier
as a custom actionRestart all servers
Notice that any
moduleconf
files have been replaced and automatically copied to all servers.
What about httpd.conf, ssl.conf and admin.conf?
Performing advanced customisations to httpd.conf
, admin.conf
and ssl.conf
is not as straight forward as defining custom routing rules under moduleconf
. For this reason, it is preferable to define all customisation via moduleconf
. In an event this approach is not feasible, it would be possible to customise these files using the combination of a template and a custom action which executes the template customisation.
To update these files you would need to:
Create a template as a custom action and register as
Plain text
type atresources/custom/ohs/httpd.conf
)Create a template as a custom action and register as
Plain text
type atresources/custom/ohs/ssl.conf
)Create a template as a custom action and register as
Plain text
type atresources/custom/ohs/admin.conf
)Create a custom action (e.g.
webtier-update-conf
) which programmatically takes the template and writes it to the desired locationCreate a global variable in the Platform Blueprint (e.g.
action.configure-webtier.post=webtier-update-conf
)Run
configure-webtier
as usual. This will result inconfigure-webtier
running and then the below custom actionwebtier-update-conf
overwriting the conf files with ones defined asPlain text
type in the custom action.
Below is an example Jython Action for replacing httpd.conf
| ssl.conf
| admin.conf
with a template
Last updated