Documentation

bemoko Platform Configuration

The bemoko platform can be configured by a file called live-config.xml or using JVM parameters. By default the system reads from the live-config.xml that is located in the web application file (war). If you wish to make system configuration changes then you should either set JVM parameters and / or create a new live-config.xml. The location of such a live-config.xml file can be configured by setting the bemoko.config.file JVM argument.

-Dbemoko.config.file=/var/bemoko/config/live-config.xml

and creating a live-config.xml file. A typical live-config.xml file for local dev environment might look like,

<live>
  <compilation>
    <targetDirectory>/var/bemoko/cache/classes</targetDirectory>
  </compilation>
  <datasource>
    <mode>jndi</mode>
  </datasource>
  <platform>
    <device-repository provider="bemoko">
      <url>jdbc:hsqldb:file:${web.app.root}/WEB-INF/bemoko-devices</url>
    </device-repository>
  </platform>
  <sites>
    <location>/var/bemoko/sites</location>
  </sites>
</live>

Configuring the Sites Locations

By default bemoko will read sites from the directory ~/bemoko/sites - i.e. in a directory called bemoko/sites in the home directory of the current user

In some cases you'll want to change this to set where you would like to store your sites. This can be configured either:

With the JVM parameter -Dbemoko.sites.location. This parameter is a colon separated list of directories, e.g:

-Dbemoko.sites.location=/opt/myproject/sites:/opt/myorg/sites

or by configuring the sites element in the live-config.xml file. You can find this file in the webapps folder of your application server. If you installed bemoko as live.war in tomcat, this file would be at [TOMCAT_HOME]/webapps/live/WEB-INF/live-config.xml file, e.g.

<live>
  <platform>
    <device-repository provider="bemoko">
      <url>jdbc:hsqldb:file:${web.app.root}/WEB-INF/bemoko-devices</url>
    </device-repository>
  </platform>
  <sites>
    <location>sites</location>
    <location>/opt/myproject/sites</location>
    <location>/opt/myorg/sites</location>
  </sites>
</live>

Note that if you have used the jumpstart method to run bemoko, you will need to use the command line option above as you the live-config.xml file will be replaced each time you start the software.

Configuring Caches

You can configure the system for production mode by enabling the "prod" Active Profile, e.g. by setting -Dbemoko.activeProfiles=prod on the JVM. This will enable the appropriate caches for you, and so in most cases you will not need to explicitly configure the caches, unless you want finer control.

Site resolver and resource loader caches are by default disabled to make life easier for a developer. When you deploy a stack to production you probably will want to enable the caches this can be done by setting the platform properties bemoko.caches.siteResolver and bemoko.caches.resourceLoader to true.

e.g. from the JVM arguments :

-Dbemoko.caches.resourceLoader.enabled=true -Dbemoko.caches.siteResolver.enabled=true

or with the live-config.xml :

<live>
  ...
  <caches>
    <resourceLoader>
      <enabled>true</enabled>
    </resourceLoader>
    <siteResolver>
      <enabled>true</enabled>
    </siteResolver>
  </caches>
</live>

Caching Compiled Plugins

You can cache compiled plugins, to improve site reload times, by creating a cache directory, e.g. /var/bemoko/cache/classes, and adding the following to the live config file.

<live>
  ...
  <compilation>
    <targetDirectory>/var/bemoko/cache/classes</targetDirectory>
  </compilation>
</live>

Configure license location

See license configuration page.

Configuring an alternative live database

For example, by default the live database is in memory and get's reset when ever bemoko is restarted, to make the live database persistent through restarts you can switch to a HSQLDB file based database, e.g.

<live>
  ....

 <datasource>
   <username>sa</username>
   <password></password>
   <driver>org.hsqldb.jdbcDriver</driver>
   <hibernate>
     <dialect>org.hibernate.dialect.HSQLDialect</dialect>
   </hibernate>
   <url>jdbc:hsqldb:file:${web.app.root}/WEB-INF/bemoko-db</url>
 </datasource>
</live>

Do not change the bemoko WAR

There is no reason to change anything inside the WAR provided by bemoko. Everything can be externally configured and the bemoko war should be treated as a black box. You're welcome to have a look inside; there are some good examples of sites inside the war such as the tutorials and the demo site. When bemoko provide upgrades we provide a complete upgrade of the WAR and will expect to you to replace the WAR in its entirety. If you feel that there is a reason for you modify something in the war, then let us know and we'll help you achieve what want to achieve.


More