As described here, Isis itself bootstraps from the
isis.properties configuration file.
It will also read configuration from the (optional) component/implementation-specific configuration files (such as
viewer_wicket.properties) and also (otional) component-specific configuration
files (such as
By convention we put JDBC URL properties in
persistor.properties, but they could reside in any of
By default these are read from the
WEB-INF directory. Having this configuration "baked into" the application is
okay in a development environment, but when the app needs to be deployed to a test or production environment, this
configuration should be read from an external location.
There are in fact three frameworks involved here, all of which need to be pointed to this external location:
which as already discussed reads
isis.properties and optional component-specific config files.
which reads the
shiro.ini file (and may read other files referenced from that file)
Each of these frameworks has its own way of externalizing its configuration.
Note that running the app from org.apache.isis.WebServer currently does not externalized Isis configuration.
To tell Isis to load configuration from an external directory, specify the
isis.config.dir context parameter.
If the external configuration directory is fixed for all environments (systest, UAT, prod etc), then you can specify within the
<context-param> <param-name>isis.config.dir</param-name> <param-value>location of external config directory</param-value> </context-param>
If however the configuration directory varies by environment, then the context parameter will be specified to each installation of your servlet container. Most (if not all) servlet containers will provide a means to define context parameters through proprietary config files.
For example, if using Tomcat 7.0, you would typically copy the empty
$TOMCAT_HOME/webapps/conf/context.xml to a file specific to the webapp, for example
$TOMCAT_HOME/webapps/conf/todo.xml. The context parameter would then be specified by adding the following:
<Parameter name="isis.config.dir" value="/usr/local/tomcat/myapp/conf/" override="true"/>
If using Isis' Shiro integration for authentication and/or authorization, note that it reads from the
shiro.ini configuration file. By default this also resides in
Similar to Isis, Shiro lets this configuration directory be altered, by specifying the
shiroConfigLocations context parameter.
You can therefore override the default location using the same technique as described above for Isis'
isis.config.dir context parameter. For example:
<Parameter name="shiroConfigLocations" value="file:/usr/local/myapp/conf/shiro.ini" override="true" />
Note that Shiro is more flexible than Isis; it will read its configuration from any URL, not just a directory on the local filesystem.
By default Isis configures log4j to read the
logging.properties file in the
WEB-INF directory. This can be overridden by setting the
log4j.properties system property to the URL of the log4j properties file.
For example, if deploying to Tomcat7, this amounts to adding the following to the
Further details an be found in the log4j documentation.
TOMCAT_OPTSin earlier versions of Tomcat.
See JVM args for other JVM args and system properties that you might want to consider setting.
All edits are reviewed before going live, so feel free to do much more than fix typos or links. If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it. Don't be surprised if we like it so much we ask you for help with other pages :)NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.