This chapter covers the following topics:

In eXo Platform, the configuration is performed in a folder whose location is controlled by a system property named exo.conf.dir. By default, the gatein.sh startup script sets this property as follows:

So the main entry point for the eXo Platform configuration is /gatein/conf/. This directory contains the following files:

This section explains some parts of the eXo Platform internals so that you can understand the roles of these configuration files.

The eXo Platform Kernel collects runtime components in the portal containers. A portal container holds all components to run a portal instance. It serves portal pages under the servlet context for its name.

The default portal container in eXo Platform is simply called "portal". This explains why the default URL of the samples is http://localhost:8080/portal.

The default portal container can be configured directly inside exo.conf.dir.

However, eXo Platform is capable of running several portal instances simultaneously on the same server. Each instance can be configured and customized independently via files located at: /gatein/conf/portal/$PORTAL_NAME, where $PORTAL_NAME is the name of the portal container.

Note

The name of the configuration file can be altered. Please refer to the section dedicated to PortalContainerDefinition in the Kernel reference for more details on portal containers and other options to modify the location of the properties.

Services that run inside a portal container are declared via the xml configuration files like configuration.xml. Such files exist in jars, wars and below exo.conf.dir.

The .xml configuration files also serve as the main way to customize the portal via the multiple plugins offered by the eXo Platform components.

Additionally, the .xml files may contain variables that are populated via properties defined in configuration.properties. Hence, the configuration.properties file serves as exposing some selected variables that are necessary to configure eXo Platform in a server environment.

configuration.properties The system configuration is mostly done in the configuration.properties file. In most cases, this should be the only file for the system administrator to configure.

configuration.xml This file contains the built-in configuration for the "portal" portal container.

This file is empty by default. This is where further customizations can be placed. Generally, custom configurations are provided by extension wars. However, this file is the last loaded by the kernel. It has a higher priority over any other configuration files, including extensions. So, you can override any internal component configuration.

This may turn handy services or configurations that are not exposed in configuration.properties.

For example, you can decide to change the default WebDAV update policy for replace with this piece of xml:

eXo Platform relies on the application server for its database access, so the database must be configured as a data source at the AS level. The data source is obtained by accessing the Enterprise Naming Context (ENC) through the Java Naming and Directory Interface (JNDI) service.

If you intend to bring your eXo Platform to production, the embedded hsql database will not be appropriate and you will need to configure your app server to use another one. You need to learn how to configure eXo Platform data sources and your app server. If you need to change the data sources name, read Change the datasources names below.

Step 1. Prepare your database server.

You need to prepare two database schema, then do as follows:

1. Connect to your database server using the ssh command:

2. Verify that MySQL is running:

3. Connect to MySQL:

In this step, you will be prompted for entering your password.

4. Create 2 databases: one for idm ($dbname-idm) and the other for jcr $dbname-jcr). For example:

i. Create the first database:

ii. Configure the user who have the remote access right (not only from the host server):

In which, $IP = AS host name, $IP = IP with wildcard (eg 192.168.1.% = all IPs on 192.168.1.x network) and $username = username that eXo Platform will connect with (i.e. 'dbnameuser').

5. Verify that both databases were created successfully:

6. Quit the server with the exit command.

Step 2. Configure eXo Platform.

After the database is ready, you need to configure eXo Platform to connect to it. The configuration steps may be different, depending on the application server. Here, instructions are for Tomcat and JBoss.

Tomcat bundle:

In Tomcat, the data sources configuration requires you to edit two files:

Tip

Please refer to Tomcat's JNDI Resources How To for more details on the JNDI resources binding in Tomcat.

To edit the server.xml file:

1. Open the file following the $TOMCAT_HOME/conf/server.xml path.

2. Declare the binding of the data sources in the GlobalNaming context:

  • Change the driver from org.hsqldb.jdbcDriver to com.mysql.jdbc.Driver.

  • Change the username and password to the values set above.

  • Change the URL to access your DataBase from jdbc:hsqldb:file:../gatein/data/hsql/exo-jcr_portal to jdbc:mysql://_$host_:3306/_$dbname_.

The code now should look like:



<!-- eXo JCR Datasource for portal -->
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" logAbandoned="true" maxActive="20" maxIdle="10" maxWait="10000" minEvictableIdleTimeMillis="60000" name="exo-jcr_portal" password="_$password_" removeAbandoned="true" removeAbandonedTimeout="10" type="javax.sql.DataSource" url="jdbc:mysql://_$host_:3306/_$dbname-jcr_" username="_$username_"/>

<!-- eXo IDM Datasource for portal -->                
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" logAbandoned="true" maxActive="20" maxIdle="10" maxWait="10000" minEvictableIdleTimeMillis="60000" name="exo-idm_portal" password="_$password_" removeAbandoned="true" removeAbandonedTimeout="10" type="javax.sql.DataSource" url="jdbc:mysql://_$host_:3306/_$dbname-idm_" username="_$username_"/>   

3. Add the JDBC driver. In this step, you need to add the MySQL connector to Tomcat by adding mysql-connector-java-5.1.x.jar to $TOMCAT_HOME/lib/.

To edit the starter.xml file:

1. Open the starter.xml file to the $TOMCAT_HOME/conf/Catalina/localhost/starter.xml path.

2. Declare the resource links that make your datasources accessible to the starter webapp which is used when starting eXo Platform.



<ResourceLink global="exo-jcr_portal" name="exo-jcr_portal" type="javax.sql.DataSource"/>

<ResourceLink global="exo-idm_portal" name="exo-idm_portal" type="javax.sql.DataSource"/>

JBoss:

To configure the data source for eXo Platform under JBoss, do as follows:

1. Edit the gatein-ds.xml file.

i. Open the file following the $JBOSS_HOME/server/default/deploy/gatein-ds.xml path.

ii. Declare the binding of the data sources in the GlobalNaming context:

The configuration should now look like:

2. Add the JDBC driver. In this step, you need to add the MySQL connector library in JBoss by adding mysql-connector-java-5.1.x.jar to $JBOSS_HOME/server/default/lib/.

3. Rename the data source.

By default, eXo Platform defines two data sources:

  • exo-jcr_portal - for the Java Content Repository (JCR).

  • exo-idm_portal - for the organizational model.

You may want to rename the data source as follows:

i. Open and edit the configuration.properties path.

In this step, indicate to eXo name of the data sources.

# JNDI name of the datasource that will be used by eXo JCR
gatein.jcr.datasource.name=java:/comp/env/exojcr
...
# JNDI Name of the IDM datasource
gatein.idm.datasource.name=java:/comp/env/exo-idm

Note

eXo Platform automatically appends the portal container name ("portal" by default) to these values before performing a JNDI lookup.

ii. Change the data source name in the application server.

In this step, you need to change the name under which the data sources are bound in the JNDI tree by the app server. This is a dependent application sever.

Q1. How to configure eXo Platform to connect to other database systems?

Configuring eXo Platform to connect to other database can be done easily. eXo Platform provides sample configuration files in the folders:

In each folder, you will find two sample xml files: gatein-ds.xml for JBoss and server.xml for Tomcat.

Each file contains 2 preconfigured datasources. For example (JCR datasource in mysql/server.xml):

You simply replace the variables with the expected values:

Variables Expected values
db.username The username that connects to the database.
db.password The password for the above user.
db.host The hostname or IP address of the DB server.
db.port The port to connect to the DB.
db.jcr.name The DB name for the JCR datasource.
db.idm.name The DB name for the IDM datasource.

Please remember to add the JDBC connector JAR in the classpath of your application server.

You can download the official JDBC connector JARs from the following websites:

Q2. How to remove the idle MySQL connections?

Some RDBMSs, like MySQL, close the idle connections after a period (8 hours on MySQL by default). Thus, a connection from the pool will be invalid and any application SQL command will fail, resulting in errors as below:

To avoid this, you can use DBCP to monitor the idle connections and drop them when they are invalid, with the parameters testWhileIdle, timeBetweenEvictionRunsMillis and validationQuery.

The validation query is specific to your RDBMS. For example, on MySQL, you would use:

In which:

You can add these parameters to the data source configuration file of your application server, for example: conf/server.xml on Tomcat.

For more details on the configuration, or some examples on other RDBMS and applications servers, please refer to:

eXo Platform requires the SMTP server to send emails, such as notifications or password reminders.

The Email service can use any SMTP account that needs to be configured in /server/default/conf/gatein/configuration.properties (Or $TOMCAT_HOME/ gatein/conf/configuration.properties if you are using Tomcat).

The relevant section looks like:

Some authenticated SMTP systems, such as GMail, GMX, MS Exchange, require the value for 'sender' or 'from' in the email message that must be identical to the SMTP user and host.

The Forum application uses it in the notification phase as the default sender. If it is not set, the sender will be empty.

mail.from Sender's email address.
gatein.email.smtp.from Sender's email address.
gatein.email.smtp.host SMTP hostname.
gatein.email.smtp.port SMTP port.
gatein.email.smtp.starttls.enable True to enable the secure (TLS) SMTP. See RFC 3207.
gatein.email.smtp.auth True to enable the SMTP authentication.
gatein.email.smtp.username Username to send for authentication.
gatein.email.smtp.password Password to send for authentication.
gatein.email.smtp.socketFactory.port Specify the port to connect to when using the specified socket factory.
gatein.email.smtp.socketFactory.class This class will be used to create SMTP sockets.

To see more details, refer to JavaMail API documentation.

For eXo Knowledge, you have to add one of the following properties to the configuration file /gatein/conf/configuration.properties to make sure that this mail service works with the authenticated SMTP systems:

mail.from= 
gatein.email.smtp.from=

The value must be the exact email address of the account configured above.

The standalone Chat server is configured in the $CHATSERVER/conf/openfire.xml file.

Configuration is based on properties expressed in the XML syntax. For example, to set the prop.name.is.blah=value property, you would write this xml snippet:

Openfire has an extensive list of configuration properties. Please read the list of all properties in Openfire documentation for more details.

The Chat server is an Openfire server bundled with plugins and configurations that allow connectivity to eXo Platform. The following properties are used to configure it.

Property Description Default value
env
serverbaseURL Base URL for all URLs below. http://localhost:8080/
restContextName Name of the rest context. rest
provider
authorizedUser.name Username to authenticate against the HTTP REST service. root
authorizedUser.password Password matching with provider.authorizeduser.name. password
eXoAuthProvider
authenticationURL URL to authenticate users. /organization/authenticate/
authenticationMethod HTTP method used to pass parameters. POST
eXoUserProvider
findUsersURL URL to find all users. /organization/xml/user/find-all/
findUsersMethod HTTP method for user/find-all. GET
getUsersURL URL to retrieve a range of users. /organization/xml/user/view-range/
getUsersMethod HTTP method for user/view-range. GET
usersCountURL URL to count users. /organization/xml/user/count/
usersCountMethod HTTP method for user/count. GET
userInfoURL URL to get user information. /organization/xml/user/info/
userInfoMethod HTTP method for user/information. GET
eXoGroupProvider
groupInfoURL URL to get group information. /organization/xml/group/info/
groupInfoMethod HTTP method for information. GET
getGroupsAllURL URL to view all groups. /organization/xml/group/view-all/
getGroupsAllMethod HTTP method for group/view-all. GET
getGroupsRangeURL URL to view a group range. /organization/xml/group/view-from-to/
getGroupsRangeMethod HTTP method for group/view-from-to. GET
getGroupsForUserURL URL to get groups for a user. /organization/xml/group/groups-for-user/
getGroupsForUserMethod HTTP method for groups-for-user. GET
groupsCountURL URL to count groups. organization/xml/group/count
groupsCountMethod HTTP method for group/count. GET

To run the chat server properly, several ports must be opened in the firewall.

Port Type Description
5222 (1) Client to server (xmpp) The standard port for clients is to connect to the server. Connections may or may not be encrypted. You can update the security settings for this port with the exo.chat.port property.
9090 && 9091 Admin Console (http) The ports used for accessing the unsecured and secured Openfire Admin Console respectively.
3478 & 3479 STUN service The port used for the service that ensures connectivity between entities behind a NAT.

The login to eXo Platform is controlled by the Java Logging API.

By default, the login is configured to:

  • log errors and warnings on the console.

  • logs /gatein/logs/gatein-YYYY-MM-DD.log.

In Tomcat, the login is configured via the conf/logging.properties file. Please refer to Tomcat's Logging Documentation for more information on how to adjust this file to your needs.

The set of properties controls the JCR behaviour.

Details:

gatein.jcr.config.type Use the cluster if you want to use eXo Platform in the cluster mode. Otherwise, leave local.
gatein.jcr.index.changefilterclass In the cluster mode, change it to org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter.
gatein.jcr.cache.config The JBoss Cache configuration for the JCR locks.
gatein.jcr.index.cache.config The JBoss Cache configuration for the JCR index.
gatein.jcr.jgroups.config The JGroups configuration to use for the cluster mode.

For more details on configuring these files, please refer to the eXo JCR reference guide.

Please refer to the Chapter 4 of this guide (Cache management view) to see the description about the cache configuration.

# Social Cache Configuration - ActivityManager
## ActivityManager.ActivityCache 
cache.exo.social.ActivityManager.ActivityCache.Capacity=4000
cache.exo.social.ActivityManager.ActivityCache.TimeToLive=43200

## ActivityManager.ActivityListCache
cache.exo.social.ActivityManager.ActivityListCache.Capacity=1000
cache.exo.social.ActivityManager.ActivityListCache.TimeToLive=7200

## ActivityManager.CommentsCache
cache.exo.social.ActivityManager.CommentsCache.Capacity=1000
cache.exo.social.ActivityManager.CommentsCache.TimeToLive=86400

# Social Cache Configuration - IdentityManager
## IdentityManager.IdentityCache
cache.exo.social.IdentityManager.IdentityCache.Capacity=1000
cache.exo.social.IdentityManager.IdentityCache.TimeToLive=3600

## IdentityManager.IdentityCacheById
cache.exo.social.IdentityManager.IdentityCacheById.Capacity=3000
cache.exo.social.IdentityManager.IdentityCacheById.TimeToLive=3600

## IdentityManager.IdentityListCache
cache.exo.social.IdentityManager.IdentityListCache.Capacity=300
cache.exo.social.IdentityManager.IdentityListCache.TimeToLive=600

# Social Cache Configuration - RelationshipManager
##  RelationshipManager.RelationshipIdCache
cache.exo.social.RelationshipManager.RelationshipIdCache.Capacity=300
cache.exo.social.RelationshipManager.RelationshipIdCache.TimeToLive=600

## RelationshipManager.RelationshipListCache
cache.exo.social.RelationshipManager.RelationshipListCache.Capacity=1000
cache.exo.social.RelationshipManager.RelationshipListCache.TimeToLive=3600

# Social Cache Configuration - SpaceStorage
cache.exo.social.SpaceStorage.SpaceCache.Capacity=300
cache.exo.social.SpaceStorage.SpaceCache.TimeToLive=7200

If all new members require access to the toolbar (but NOT the Content Management System (CMS)), administrators can change the default portal behavior to meet your request by doing the following steps:

1. Define the group of new members in the organization-configuration.xml file defined in the path tomcat/webapps/ecmdemo/WEB-INF/conf/sample-portal/portal/organization-configuration.xml.



<component-plugin>
      <name>wcm.new.user.event.listener</name>
      <set-method>addListenerPlugin</set-method>
      <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
      <description>this listener assign group and membership to a new created user</description>
      <init-params>
        <object-param>
          <name>configuration</name>
          <description>description</description>
          <object type="org.exoplatform.services.organization.impl.NewUserConfig">
            <field name="group">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
                    <field name="groupId"><string>/platform/users</string></field>
                    <field name="membership"><string>member</string></field>
                  </object>
                </value>                
              </collection>
            </field>
            <field name="ignoredUser">
              <collection type="java.util.HashSet">
                <value><string>james</string></value>
              </collection>
            </field>
          </object>
        </object-param>
      </init-params>
</component-plugin>

The sample configuration above sets the group of new users to the /platform/users group with the member role.

2. Customize the value of <access-permissions> in the sharedlayout.xml file defined in the path tomcat/webapps/ecm-wcm-extension/WEB-INF/conf/portal/portal/sharedlayout.xml file as follows:

3. Restart the server.

If all users require access to both the toolbar and the underlying CMS implementation, administrators can change the default portal behavior to grant the appropriate permissions to newly registered users:

1. Do the same as Step 1 and Step 2 of "Grant all users access to toolbar but not CMS".

2. Edit the organization-configuration.xml file and add /platform/web-contributors to wcm.new.user.event.listener. See the example below:



<component-plugin>
      <name>wcm.new.user.event.listener</name>
      <set-method>addListenerPlugin</set-method>
      <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
      <description>this listener assign group and membership to a new created user</description>
      <init-params>
        <object-param>
          <name>configuration</name>
          <description>description</description>
          <object type="org.exoplatform.services.organization.impl.NewUserConfig">
            <field name="group">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
                    <field name="groupId"><string>/platform/users</string></field>
                    <field name="membership"><string>member</string></field>
                  </object>
                </value>
                <!-- new users should also be a member of the web-contributors group to see the top toolbar -->
                <value>
                  <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
                    <field name="groupId"><string>/platform/web-contributors</string></field>
                    <field name="membership"><string>member</string></field>
                  </object>
                </value>
              </collection>
            </field>
            <field name="ignoredUser">
              <collection type="java.util.HashSet">
                <value><string>james</string></value>
              </collection>
            </field>
          </object>
        </object-param>
      </init-params>
</component-plugin>

3. Restart the server.

In eXo Platform, you could allow gadgets to load remote resources. However, this could be a potential security risk, as it will make the Gadget deployey as an open web proxy. This implies configuring ProxyFilterService.

The default configuration is set as below:

This configuration can be added into <GATEIN_CONF_DIR>/portal/<PORTAL_CONTAINER_NAME>/configuration.xml.