Server environment

Basic configuration

The whole MobileCoach Website can be configured using one configuration file web_configuration.properties which is included in the repository containing example values. All folders mentioned in this file should be created before the first startup of the MobileCoach Website system.

Your adjusted copy of the web_configuration.properties can be placed anywhere on your system, but the file need to be referenced as system property with the name mc_website.configuration (or virtualservername.xyz.mc_website.configuration if you run several virtual servers). Otherwise the default configuration from the Constants.java will be used - and you won't like it.

To define the system property you can start your java runtime with the following parameter:

Also the following should be added to avoid encoding problems on several operating systems and/or RAM problems:

-server -Dfile.encoding=UTF8 -Djava.awt.headless=true -Xms2g -Xmx2g

Suggestion:
Ensure that your Tomcat installation is allowed to read and write to all folders configured in the configuration.properties

Suggestion:Mobile Coach is tested with Apache Tomcat 8(.5)

Redirect configuration

The mapping between the subdomains and the web folders can be done in the src/ch.ethz.mc.root/RedirectManager.java enumeration AllowedSubDomains. All redirects containing hash symbols (#) and the WWW element should not be deleted, while the other subcomains can be configured are required for the appropriate server setup, e.g.

DEV("developer")

configures the server to provide the website available in WebContent/WEB-INF/www/developer on the subdomain dev.YOURDOMAIN.WHATEVER

Mini CMS configuration

Calling the root URL of the website leads to a specific behaviour instead of all other calls: It redirects the user to the main website of the system. This website is based on the file WebContent/WEB-INF/www/root/template.htm. This file can contain several placeholders in the form ##NUMBERS_OR_LETTERS## as CMS placeholders or $$PROPERTY_NAME_FROM_STATISTICS_FILE$$.

This website can be managed using the URL /admin on your root URL to access the CMS backend. A tomcat user with the user role mobile-coach has to be configured in the web container to access this website.

All placeholers used in the template need to be created as empty files in the WEBSITE_DATA_CONTENT_PATH configured in the Constants.java with the extension .md.

For example:

##01_Introduction##

requires a file 01_Introduction.md to be created in the WEBSITE_DATA_CONTENT_PATH.

The file WebContent/WEB-INF/www/root/_instructions.md should also be moved to the WEBSITE_DATA_CONTENT_PATH to provide basic usage information in the CMS backend.

As you can see in the instructions file the CMS uses a very simple Markdown syntax.

An example template.htm is already provided in the release.

Further information

For further information have a look at the README.md file in the main repository of the MobileCoach.