Server configuration

The ηCMS server configuration is defined in the XML file. At the start the server reads the OS environment or system JVM property: WEBOOT_CFG_LOCATION, specifying the configuration file. The file can be a file system resource or a resource in server classpath on JVM. The system won’t be launched if WEBOOT_CFG_LOCATION isn’t set by one of the methods stated above.

To work with the server configuration we use Apache Сommons Сonfiguration and, as a consequence, a reference to values of other items are supported in the file, e.g.:


where server-name and server-port are XML items of the configuration.

Additionally, in the configuration file you can use substitutes (placeholders) as {name}, where {name} can take the following values:

  • {cwd} – current working directory
  • {home} – home directory of the user who runs the ηCMS server
  • {tmp} – temporary folder
  • {newtmp} – unique temporary directory for the running application
  • {webapp} – path to the root of the deployed web application
  • {env:NAME} – where NAME - the name of the environment variable
  • {sys:NAME} – where NAME - the name of the JVM system property

Example of ηСМС configuration file

<?xml version="1.0" encoding="utf-8" ?>
    <!-- Reference to the logging configuration relative
         to this config file

    <!-- Application name -->
    <app-name>My app</app-name>

        Application working mode:
        - production    Working in production
        - dev           Developer mode, debugging enabled.
        - test          Testing
    <!-- Domain name of web-server or IP-address for external clients by default -->
    <!-- Server port -->
        <!-- Main web-server HTTP url -->
        <!-- If true, then the webserver address for external
             clients (for example for email messages and links)
             is created based on the data of client's HTTP requests
             if it is possible. Otherwise configuration
             parameter `site/root` is used.

    <!-- Application prefix with respect to the web container root.

        A list of additional resources used for localization
        of server messages.  If you do not use additional localized resources,
        this configuration section can be omitted.
        Refer to

        <!-- The directory in the ηCMS media repository,
                 which is the root for files/resources
                 available as a web resources via HTTP-protocol.
             Default value: /site -->

    <!-- Configuration of static web-resources,
         stored in .jar files of the application -->
        <!-- Administrative site area,
             available by the address: /adm -->

    <!-- ηCMS resource caching on the client side  -->
            <!-- All css and js files are cached for 2 hours-->
            <!-- Static media resources of sites are cached for 2 hours -->
            <!-- Cancel caching for all resources in /adm/script/* -->

    <!-- File of a database schema creation -->
        <!-- Liquibase updates the database structure at the server start -->

    <!-- Parameters of communication between the application and the database -->
        <!-- Mybatis application configuration -->
        <!-- File containing the login and password for the connection to the database -->
                <!-- Additionally, plug in the Mybatis configuration
                     if you are to extend the ηCMS functionality
                     Refer to -->

        <!-- Directory where ηCMS media files are stored -->
        <!-- The maximum size of the file loaded to ηCMS (bytes).
             By default 30MB -->
        <!-- The maximum size of the data stored in the RAM cache
                 of the ηCMS server while uploading a file.
             By default 10MB-->
        <!-- The size of preview icons for the images in the ηCMS media repository -->
        <!-- The maximum size of the text file being edited in a editor -->
        <!-- Set of automatic import rules <import>
             of media-files from the file storage (where the ηCMS server works)
            <!-- Source directory for import -->
            <!-- Target directory for import -->
            <!-- Watch for changes in the source files -->
            <!-- If the file in the target directory was modified later than the source file,
                 it will not be overwritten. By default: false -->
            <!-- Templates of files included to the source directory
                 same as Ant include patterns
            <!-- Templates of files excluded from the source directory -->

    <!-- Configuration of the HTTL markup parser.
         extensions: Possible extensions of httl files.
                     By default: *,httl,html,httl.css -->
    <httl extensions="*,httl,html,httl.css">
        <!-- HTTL configuration properties
             Refer to -->

    <!-- ηCMS authentication and authorization setting -->
        <!-- Location of the user ηCMS Database in an XML file.
             placeTo: Optional. Location to copy the user database
                      for the future editing via the ηCMS user management interface  -->
        <xml-user-database placeTo="{home}/.myapp/mayapp-users.xml">
            <!-- Initial path to the classpath for the read-only ηCMS users database.
                     If placeTo attribute is set and the file is missing, the database will be copied
                 to the location determined via placeTo -->
        <!-- Hash  generation algorithm for passwords in an XML database ηCMS users.
                 Possible values:
                - sha256
                - bcrypt
                - empty string or absent element: passwords are not encrypted
        <!-- Path to the Shiro( configuration
             used in ηCMS -->
        <!-- ηCMS user database name -->

    <!-- UI administrator components -->
            <!-- ηCMS pages management components
                 roles: roles of users
                        having access to the component -->
            <widget qxClass="ncms.pgs.PagesNav" roles="user"/>
            <!-- ηCMS news and events feed -->
            <widget qxClass="" roles="user"/>
            <!-- Interface of media files management -->
            <widget qxClass="ncms.mmgr.MediaNav" roles="user"/>
            <!-- Interface of assembly management -->
            <widget qxClass="ncms.asm.AsmNav" roles="admin.asm"/>
            <!-- Interface of  Marketing transfer tools (MTT) -->
            <widget qxClass="ncms.mtt.MttNav" roles="mtt" extra="true"/>
            <!-- Interface of MTT tracking pixels management
            <widget qxClass="" roles="mtt" extra="true"/>
            <!-- Interface of user and user access management -->
            <widget qxClass="ncms.usr.UsersNav" roles="admin.users" extra="true"/>

        <!-- The maximum width of the image when displaying within mediawiki page -->
        <!-- Additional mediawiki tags -->
            <tag name="note" class="com.softmotions.ncms.mediawiki.NoteTag"/>
            <tag name="gmap" class="com.softmotions.ncms.mediawiki.GMapTag"/>
            <tag name="youtube" class="com.softmotions.ncms.mediawiki.YoutubeTag"/>
            <tag name="tree" class="com.softmotions.ncms.mediawiki.TreeTag"/>
            <tag name="slideshare" class="com.softmotions.ncms.mediawiki.SlideSharePresentationTag"/>
            <tag name="extimg" class="com.softmotions.ncms.mediawiki.ExternalImageTag"/>
            <tag name="vimeo" class="com.softmotions.ncms.mediawiki.VimeoTag"/>
            <tag name="ind" class="com.softmotions.ncms.mediawiki.IndentTag"/>

    <!-- Additional Guice modules
         registered when ηCMS starts.
         Refer to -->

Additional (Advanced) configuration items

<?xml version="1.0" encoding="utf-8" ?>
        <!-- Loaders of HTTL templates.
             By default a loader of media files of the ηCMS repository is used.

        <!-- The maximum size of the LRU cache
                 for the storing of the meta information (com.softmotions.ncms.asm.CachedPage)
                 about recently used pages of the site.
             By default: 1024 -->

        <!-- Maximum LRU size of a cache for page aliases.
             For the fast search of a page using its alias.
             By default: 8192

        <!-- List of directories in the ηCMS media repository
             which are to be marked as 'system' -->

        <!-- Maximum LRU cache size
             for storage of user access control list (ACL)
             to the website pages.
             By default: 1024

        <!-- Registration of additional
             interwiki links to ηCMS mediawiki unit (module).
             API project Bliki
            <link key="page" value="/asm/$1"/>


    <!-- Help page references for ηCMS UI elements.
         The format: key => link to the reference page
         There are the following keys in the current version: wiki.gmap, wiki -->
            <!-- Information on how to enter the frame of the Google Maps location -->
            <topic key="wiki.gmap"></topic>
            <!-- Information on wiki markup -->
            <topic key="wiki">...</topic>

        <!-- The number of threads that are used
                  to handle asynchronous events in ηCMS
                  Default: 1 thread.
                  Do not change this setting,
                  if you do not exactly know what you are doing

    <!-- Task executor configuration for different
         asynchronous tasks. -->
    <executor> <!-- set of elements -->
        <!-- executor name -->
        <!-- Number of threads -->
        <!-- Maximum size of the task queue