GlassFish 4 glassfish-acc.xml file: What is the purpose of the name attribute of the target-server element? - glassfish

In the GlassFish 4 glassfish-acc.xml file, what is the purpose of the name attribute of the target-server element?
It seems that this file has something to do with IIOP.
Different installs of GlassFish 4 have different values for that attribute, but the rest of the files are exactly the same. Some example values of this attribute are:
sc11152542.us.oracle.com
sc11152550.us.oracle.com
I am trying to standardize the configs of some inherited GlassFish 4 servers. They are not clustered. Would it be OK for me to use the same value for all my servers? If so, does it matter which value I choose?
I read the documentation from the following link, but it was too tautological to be useful.
https://glassfish.java.net/docs/4.0/application-deployment-guide.pdf
The documentation also appears to be out of date, since it refers to sun-acc.xml instead of glassfish-acc.xml, and because it uses version 1.2 of the DTD while the glassfish-acc.xml files that I've seen use version 1.3.

Related

How to encrypt server.ssl.key-store-password value and use it in SpringBoot

I would like to know is there anyway we can encrypt the server.ssl.key-store-password value and store it in application.properties file instead of storing it in plain text.
i couldn't find any documentation on this. Any help on this is highly appreciated.
Thanks in advance.
Spring allows you to encrypt the properties file but the key for that encryption needs to be kept somewhere. This answer suggest keeping them in environment variables and points to a guide about how to encrypt them if you still want to.
You can use "jasypt-spring-boot-starter" for your need. All you to need to do are the following steps.
Download the "jasypt-spring-boot-starter" from maven central repo.
com.github.ulisesbocchio
jasypt-spring-boot-starter
x.x.x
In your Spring Boot start file where the "#SpringBootApplication" annotation is located, just include "#EnableEncryptableProperties". A point to note here is that once you place encryptable properties annotation on the main start file, all the property files of your application will be loaded and scanned by Jaspyt module for any property value that is marked starting with "ENC".
In your "application.properties" file there are few more configurations that needed to be added like below (all these are defaults and you can change these according to your requirement):
jasypt.encryptor.password=<Some password for encryption>
jasypt.encryptor.algorithm=PBEWITHHMACSHA256ANDAES_128
jasypt.encryptor.key-obtention-iterations=1000
jasypt.encryptor.pool-size=1
jasypt.encryptor.salt-generator-classname=org.jasypt.salt.RandomSaltGenerator
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.RandomIvGenerator
jasypt.encryptor.string-output-type=base64
Once you are done with the above steps, now you can place your encrypted property value under the ENC(). Jasypt will scan values which are enclosed in ENC() and will try to decrypt the value.
For e.g.
spring.datasource.password=ENC(tHe0atcRsE+uOTxt2GmFYPXNHREch9R/12qD082gw7vv6bby5Rk)

Adding a second webapp

I am struggling to setup a public website in Moqui, I am trying to have (dev-)www.example.net as the public marketing site and signup forms. Then the tennants on [tennant-name].example.net I have setup a basic component and then edited MoquiDevConf.xml, modified the webapp-list as shown below:
<webapp-list>
<webapp name="webpublic" http-port="8080" https-enabled="false">
<root-screen host="dev-www.example.net" location="component://webpublic/screen/webpublic.xml"/>
</webapp>
<webapp name="webroot" http-port="8080" https-enabled="false">
<root-screen host="^((?!dev-www.example.net).)*$" location="component://webroot/screen/webroot.xml"/>
</webapp>
</webapp-list>
I have restarted the app for the changes to take effect but all I get is an error 500 when I try and visit http://dev-www.example.net:8080/
org.moqui.BaseException: Could not find root screen for host [dev-www.example.net]
As far as I can tell Moqui is finding the component as I see this in the logs:
Added component [webpublic] at [file:/Volumes/MacHDD/Sources/atlas-moqui/runtime/component/webpublic]
Non dev-www hosts still work and I get the customary login screen so I am not sure what I am missing as this is almost a direct copy of the existing webroot?
Thanks for any help!
Sam
You probably using the same port number. Try different one (e.g. 8081) for the second one. All used ports should be different. Please see my comment as well.
My guess about why your particular configuration is not working is that the root-screen.#host attribute is always a regular expression and the URL you are using contains special characters including '-' and '.'. It should work if you escape these characters with a '\', i.e. use '.' and '-'.
That said, if you want to support virtual hosts with the same webapp root for multiple tenants you shouldn't need to declare the virtual hosts this way, this is only needed if you want a different webapp root screen (which may be what you eventually want to do).
UPDATE: With the configuration snippet above the issue is that there are multiple webapp-list.webapp elements, one with name=webroot which is the webapp used (as specified in the web.xml file in the moqui-name context-param) and the other with name=webpublic which is ignored because the configuration is found based on the name from the web.xml file.
The solution is to put both root-screen elements under the webapp element with name=webroot. Basically the way these are looked up is not arbitrary, it is explicit for the webapp name (the moqui-name context-param). If you have multiple webapps deployed they should have different moqui-name values to refer to different configurations. This would best be done in something other that Winstone, something like Tomcat. It would also stray from the documented ways of deploying Moqui, so a bit more work would need to be done. There isn't any really point in doing this, better to run everything in the same webapp with multiple root-screen elements and multiple root screens as needed.

Mule Multiple flows loading shared properties file

I have a mule application comprising of 10 mule XML files. Some of these XML files need to use same property from commong prperties (config.properties) file.
(1) Should ALL the flows that need use a given property load the properties file containing that property using --
<context:property-placeholder location="config.properties" />
(2) OR should only one of the XML file add property-placeholder?
(3) If option (2) is right, then does the order of mentioning the xml files as config.resources in mule-deploy.properties play any role?
Please shed some light on this.
You only need it once, and it does not matter where you put it.
You only need one property file and you can setup this for 3 environments liks DEV,QA and PROD and setop property to pick right file.
There is a lot of documentation that shows users different ways to read a properties file in Mule flows.
Here are three approaches on how you can do this:
Reading a properties file using ${Key} expression
Reading a properties file using ![p[‘Key’]] expression
Reading a properties file using p() function from DataWeave
If you deploy multiple applications through a Shared Resources structure, don’t set anything in the properties files, as there might potentially be conflicts between the various apps that share a domain. Instead, set environment variables over the scope of the deployed app, its domain, and other apps under that domain.
As explained in Shared Resources, in Studio you can create these variables through the Environment tab of the Run Configurations menu, reachable via the drop-down menu next to the Play button.

wix toolset - expected values for ManagedRuntimeVersion / ManagedPipelineMode

I am trying to create an MSI using the WiX toolset. I have a couple questions:
In the WebAppPool documentry there are two Properties: ManagedRuntimeVersion and ManagedPipelineMode. What are the expected values for them?
The documentation mentions that they can be set using formatted Property. What are these Properties?
I'll highly appreciate a sample.
ManagedRuntimeVersion refers to the version of .NET the app pool should use (e.g. v4.0)
ManagedPipelineMode refers to the pipeline mode the app pool should run in (e.g. integrated)
Formatted properties just means you can set the values using the name of a Property (wix docs) instead of specifying the value inline

Adding custom configuration in config.yml in Symfony 2.1

I want to do custom configuration parameters in config.yml
Example:
In config.yml file
security_enhancement:
authentication:true
authorization:true
In same format like swiftmailer configuration etc.I'm not getting idea how to define.
I'm getting error like:
1/2 ParseException: Unable to parse in "\/var\/www\/demo\/app\/config\/config.yml" at line 217 (near "authentication:true").
Am I missing something here? Is it necessary to add in depending injection extension file? .Actually I want to enable disable authentication,authorization execution during dev mode which is implemented in listener which can be done using config_dev.yml . I don't want to add under Parameters. Any suggestions?
As you've rightly theorised, you do indeed need to add in DI extension files, assuming your configuration relates to particular bundles (which it almost certain will).
Whilst parameters can simply be defined at will, configuration features hierarchical structure and validation.
Usually, configuration is used to in turn, define parameters, but it allows for the values to be parsed and validated prior to their instantiation, so that bundle writers can provide better guidance as to how their services can be used (with meaningful errors), and trust the values that are being passed into them.
A decent read on how to get started with config component can be found in the Symfony2 docs: defining and processing configuration files with the config component.