{docbook}
<abstract>
<para>
This chapter covers the following topics:
</para>
<itemizedlist>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.eXo_Configuration">eXo Platform configuration</link></emphasis>
</para>
<para>
Explanation of eXo Platform configuration, its directory and some parts of eXo Platform internals.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.Database_Configuration">Database configuration</link></emphasis>
</para>
<para>
Introduction to a database configuration, steps to connect to a production database, and FAQs of database configuration.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.File_system_paths">File system paths</link></emphasis>
</para>
<para>
Explanations of several paths in the local file system.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.JCR_Workspaces">JCR system and default workspaces</link></emphasis>
</para>
<para>
The configuration of workspaces for the JCR repository.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.JCR_TransactionService">Transaction Service</link></emphasis>
</para>
<para>
Information about the default timeout value of JCR transaction, and the value when your application runs longer transactions.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.MailServer">Mail server</link></emphasis>
</para>
<para>
Introduction to the Email service of eXo Platform that requires the SMTP server to send emails, such as notifications or password reminders.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.Notification_email_config">Email-notification configuration for watching a document</link></emphasis>
</para>
<para>
Instructions on how to customize the email notification that allows you to receive email notifications of changes on your selected documents.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.WedDAV_cache_control">WebDAV cache control</link></emphasis>
</para>
<para>
Introduction to the embedded WebDAV server that lets you control the cache-control HTTP header.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.Chat_Server">Chat server</link></emphasis>
</para>
<para>
Information about XMPPMessenger, and Chat server configuration.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.Office_server">Office server</link></emphasis>
</para>
<para>
Instructions on how to start the Office server through which users can view various types of documents directly in the Sites Explorer.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.Logs">Logs</link></emphasis>
</para>
<para>
Introduction to the logs of eXo Platform, and where to configure this function.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.JCR">JCR</link></emphasis>
</para>
<para>
Details of the set of properties which control the JCR behavior.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.CacheConfiguration">Cache configuration</link></emphasis>
</para>
<para>
Overall introduction to the Cache configuration of eXo Platform, including: Portal, Social, and ECMS.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.Users_configuration">Users configuration</link></emphasis>
</para>
<para>
Instructions on how to configure a super-user and to grant users access to toolbar.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.Gadget_configuration">Gadget configuration</link></emphasis>
</para>
<para>
Information about the OAuth key that will be used in case the OAuth gadgets do not indicate a key.
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold"><link linkend="ADM.Configuration.Other_properties">Other properties</link> </emphasis>
</para>
<para>
Introduction to other properties, such as Navigation Controller, JNDI, IDM.
</para>
</listitem>
</itemizedlist>
</abstract>
{docbook}

h1. eXo Platform configuration {anchor:id=ADM.Configuration.eXo_Configuration}

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:

{code}-Dexo.conf.dir.name=gatein/conf{code}

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

* _configuration.properties_: the main system configuration.

* _configuration.xml_: contains the default portal container configuration.

* _portal/portal/configuration.xml_: the main external customization entry point for the default portal container.


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 [PortalContainer|../../reference/html/PortalContainer.html] section in the Kernel reference for more details on portal containers and other options to modify the location of the properties.
{note}

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.

{docbook}
<citetitle>
<para xml:id="ADM.Configuration.Configuration.properties">
<emphasis role="bold">
configuration.properties
</emphasis>
</para>
</citetitle>
{docbook}

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.
* In the Tomcat bundle, this file is located at _/gatein/conf/configuration.properties_.
* In the JBoss server, this file is located at _server/default/conf/gatein/configuration.properties_.

{docbook}
<citetitle>
<para xml:id="ADM.Configuration.Configuration.xml">
<emphasis role="bold">
configuration.xml
</emphasis>
</para>
</citetitle>
{docbook}

This file contains the built-in configuration for the "portal" portal container.
* In most cases, you should not change this file. 
* In case you do not want to use "portal" as the default portal for your project, this file can be used to import another PortalContainerDefinition into the root container.

{note}
To learn more about how to configure a new portal container, please refer to the [Kernel reference guide|../../reference/html/chapter-Kernel.html].
{note}

{docbook}
<citetitle>
<para xml:id="ADM.Configuration.portal/portal/configuration.xml">
<emphasis role="bold">
portal/portal/configuration.xml
</emphasis>
</para>
</citetitle>
{docbook}

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 change the default WebDAV update policy by adding the following code to this _configuration.xml_ file:

{code:xml}<component>
  <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
  <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
  <init-params>
    <value-param>
      <name>auto-mix-lockable</name>
      <value>false</value>
    </value-param>
    <value-param>
      <name>def-folder-node-type</name>
      <value>nt:folder</value>
    </value-param>
    <value-param>
      <name>def-file-node-type</name>
      <value>nt:file</value>
    </value-param>
    <value-param>
      <name>def-file-mimetype</name>
      <value>text/plain</value>
    </value-param>
    <value-param>
      <name>update-policy</name>
      <value>replace</value>
    </value-param>
  </init-params>
</component>{code}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]

h1. Database configuration {anchor:id=ADM.Configuration.Database_Configuration}

{docbook}
<highlights>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="ADM.Configuration.Connect_To_A_Production_Database">Connect to a production database</link>
            </para>
			<para>
			Steps to prepare your database server and to configure eXo Platform.
			</para>
          </listitem>
          <listitem>
            <para>
              <link linkend="ADM.Configuration.FAQDatabaseConfiguration">FAQs of database configuration</link>
            </para>
			<para>
			Questions and answers about configuring eXo Platform to connect to other database systems, removing the idle MySQL connections, and enabling managed DataSource.
			</para>
          </listitem>
        </itemizedlist>
</highlights>
{docbook}

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.

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]

h2. Connect to a production database {anchor:id=ADM.Configuration.Connect_To_A_Production_DatabaseRoleNotInToc}

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 the [Rename the data source|#rename_data_source] section below.

{info}
The steps below will show you how to configure eXo Platform to use a MySQL database. You need to adapt them to your actual production environment.
{info}

{tip}
Refer to the [FAQs of database configuration |#ADM.Configuration.FAQDatabaseConfiguration] section to find out our sample configuration files for MySQL and other DB systems.
{tip}

*Step 1.* *Prepare your database server.* {anchor:id=ADM.Configuration.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: 

{code}ssh root@db.example.org{code}

*2.* Verify that MySQL is running: 

{code}sudo /etc/init.d/mysqld status{code}

*3.* Connect to MySQL: 

{code}mysql -u root -p{code}

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.
 
{code}create database _$dbname_;{code}

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

{code}grant all on _$dbname_.* to '_$username_'@'_$IP_' identified by '_$password_';{code}

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. 'dbname_user').

*5.* Verify that both databases were created successfully.

{code}show databases;{code}

*6.* Quit the server with the *exit* command.

{note}
eXo Platform does not require tables to be created before it starts because these tables are created automatically on the first startup. If you want to run the DDL script to create the database objects, please contact eXo Support to obtain the script for your database.
{note}

*Step 2.* *Configure eXo Platform*. {anchor:id=ADM.Configuration.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*: {anchor:id=ADM.Configuration.Tomcat_Bundle}

In Tomcat, the data sources configuration requires you to edit the _server.xml_ file.

{tip}
Please refer to Tomcat's [JNDI Resources How To|http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html] for more details on the JNDI resources binding in Tomcat.
{tip}

{docbook}
<citetitle>
<para>
<emphasis role="bold">
Edit the server.xml file
</emphasis>
</para>
</citetitle>
{docbook}

*1.* Open the _$PLATFORM\_TOMCAT\_\HOME/conf/server.xml_ file.

*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_ into _jdbc\:mysql\://\_\$host\_\:3306/\_\$dbname\__.

The code now should look like:

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

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

*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 _$PLATFORM\_TOMCAT\_\HOME/lib/_.


*JBoss*: {anchor:id=ADM.Configuration.JBoss}
{docbook}
<citetitle>
<para>
<emphasis role="bold">
Configure the data source for eXo Platform under JBoss
</emphasis>
</para>
</citetitle>
{docbook}

* Edit gatein-ds.xml

* Add the JDBC driver

*1.* Edit the _gatein-ds.xml_ file.

*i.* Open the _$PLATFORM\_JBOSS\_\HOME/server/default/deploy/gatein-ds.xml_ file.

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

* Change the driver: _org.hsqldb.jdbcDriver_ into _com.mysql.jdbc.Driver_.

* Change the username and password to the values set earlier.

* Change the URL to access your database: _{{{<connection-url>jdbc:hsqldb:${jboss.server.data.dir}/exo/hypersonic/exo-xxx_portal-localDB</connection-url>}}}_ to _<connection-url>jdbc:mysql://_$host_:3306/_$dbname_</connection-url>_.

The configuration should now look like:

{code:xml}<datasources>
    <no-tx-datasource>
      <jndi-name>exo-idm_portal</jndi-name>
      <connection-url>jdbc:mysql://_$host_:3306/_$dbname-idm_</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>_$username_</user-name>
      <password>_$password_</password>

      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
      <prepared-statement-cache-size>32</prepared-statement-cache-size>
   </no-tx-datasource>
<!-- ...  -->
   <no-tx-datasource>
      <jndi-name>exo-jcr_portal</jndi-name>
      <connection-url>jdbc:mysql://_$host_:3306/_$dbname-jcr_</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>_$username_</user-name>
      <password>_$password_</password>

      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
      <prepared-statement-cache-size>32</prepared-statement-cache-size>
   </no-tx-datasource>
</datasources>{code}

*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 _$PLATFORM\_JBOSS\_\HOME/server/default/lib/_.

{tip}You can get the latest MySQL connector [here|http://dev.mysql.com/downloads/connector/j/].{tip}

*3.* Rename the data source.  {anchor:id=rename_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_ file.

In this step, indicate eXo name of the data sources. The database schema of Hibernate service for IDM tables is optionally defined by the {{{gatein.idm.datasource.schema}}} property.

{code}# 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

# Optional database schema for use with IDM tables (empty by default), uncomment this line to specify required schema name
#gatein.idm.datasource.schema=EXO1{code}

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

*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.

h2. FAQs of database configuration {anchor:id=ADM.Configuration.FAQDatabaseConfigurationRoleNotInToc}

{docbook}
<citetitle>
<para xml:id="ADM.Configuration.FAQDatabaseConfiguration.Connect_to_other_database_system">
<emphasis role="bold">
Q1. How to configure eXo Platform to connect to other database systems?
</emphasis>
</para>
</citetitle>
{docbook}


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

* *eXo Platform-3.5.x.zip/conf/db/*
** mysql
** oracle
** postgres

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 data sources. For example: JCR data source in _mysql/server.xml_:

{code:xml}<Resource name="exo-jcr_portal" auth="Container" type="javax.sql.DataSource"
          maxActive="128" maxIdle="32" maxWait="10000"
          testWhileIdle="true" timeBetweenEvictionRunsMillis="30000" validationQuery="SELECT 1" 
          username="${db.username}" password="${db.password}" driverClassName="com.mysql.jdbc.Driver"
          url="jdbc:mysql://${db.host}:${db.port}/${db.jcr.name}"/>{code}

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 username. |
| 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 to the classpath of your application server.

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

* http://www.mysql.com/downloads/connector/j/
* http://jdbc.postgresql.org/download.html
* http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html


{docbook}
<citetitle>
<para xml:id="ADM.Configuration.FAQDatabaseConfiguration.Remove_idle_MySQL_connections">
<emphasis role="bold">
Q2. How to remove the idle MySQL connections?
</emphasis>
</para>
</citetitle>
{docbook}
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:

{code}org.hibernate.SessionException: Session is closed!
at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72)
at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1342){code}

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

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

{code:java}testWhileIdle="true" timeBetweenEvictionRunsMillis="30000" validationQuery="SELECT 1"{code}

In which:

* *testWhileIdle* activates idle connections monitoring.
* *timeBetweenEvictionRunsMillis* defines the time interval between two checks in milliseconds (5 minutes in the example).
* *validationQuery* provides a simple SQL command to validate the connection to the RDBMS.

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 the following websites:

* http://markmail.org/message/a3bszoyqbvi5qer4
* http://stackoverflow.com/questions/15949/javatomcat-dying-databse-connection
* http://confluence.atlassian.com/display/JIRA/SurvivingConnectionClosures


{docbook}
<citetitle>
<para xml:id="ADM.Configuration.FAQDatabaseConfiguration.Enable_managed_datasource">
<emphasis role="bold">
Q3. How to enable managed DataSource?
</emphasis>
</para>
</citetitle>
{docbook}
When you want to use a managed data source (which is the case under JBoss), set "true" for the {{gatein.jcr.datasource.managed}} property in the {{configuration.properties}} file.
{code:java}# indicates if the jcr datasource is using managed transactions. 
# false by default. 
gatein.jcr.datasource.managed=true{code}

h1. File system paths {anchor:id=ADM.Configuration.File_system_paths}
eXo Platform requires the read/write access to several paths in the local file system.

{code}# Arjuna configuration
com.arjuna.ats.arjuna.objectstore.objectStoreDir=${gatein.data.dir}/jta
.....

# Directory for common data (in cluster, mount it as a network shared directory between nodes)
# On standalone JBoss app server it is assignet to ${jboss.server.data.dir} by default.
exo.shared.dir=../gatein

# Configuration directory (in cluster, this directory is per node)
# Usual locations of configuration directory:
# for Tomcat app server it is ${catalina.home}/gatein/conf.
# for JBoss app server it is ${jboss.server.home.dir}/conf/gatein.
gatein.conf.dir=${catalina.home}/${exo.conf.dir.name}

# Data directory
gatein.data.dir=${exo.shared.dir}/data

# path for any JCR data 
gatein.jcr.data.dir=${gatein.data.dir}/jcr

# path for file data inserted in JCR
gatein.jcr.storage.data.dir=${gatein.jcr.data.dir}/values

# path for the jcr index
gatein.jcr.index.data.dir=${gatein.jcr.data.dir}/index{code}

The following table explains what goes in which path. The *Temporary* column indicates if the data are temporary or persistent (V: temporary, X: persistent).

|| Variable || Content || Temporary ||
| {{com.arjuna.ats.arjuna.objectstore.objectStoreDir}} | JTA transactional data. | V |
| {{gatein.jcr.data.dir}} | Directory for JCR data. | X |
| {{gatein.jcr.data.dir}}/swap | Directory for swapped data of JCR | V |
| {{gatein.jcr.storage.data.dir}} | Binary value storage for JCR.| X |
| {{gatein.jcr.index.data.dir}} | Lucene index for JCR. | X |

Each variable can be defined as an absolute or a relative path.
The default configuration combines them to obtain a compact tree:

{code}/gatein       # gatein.data.dir
  /data
    /hsql
    /jcr      # gatein.jcr.data.dir
      /index  # gatein.jcr.index.data.dir    
      /swap
      /values # gatein.jcr.storage.data.dir    
    /jta{code}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]

h1. JCR system and default workspaces {anchor:id=ADM.Configuration.JCR_Workspaces}
The following is the configuration of workspaces (default and system) for JCR repository.
{code:java}# JCR system and default workspaces
gatein.jcr.repository.default=repository
gatein.jcr.workspace.default=collaboration
gatein.jcr.workspace.system=system{code}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]
* [Transaction Service|#ADM.Configuration.JCR_TransactionService]
* [JCR|#ADM.Configuration.JCR]

h1. Transaction Service {anchor:id=ADM.Configuration.JCR_TransactionService}

JCR transaction default timeout configured for 7 mins (420 sec) by default. If your application runs longer transactions, you might need a bigger timeout.
{code:java}# JCR Transaction Service
# TransactionService default timeout (in seconds), set it to one hour here:
gatein.jcr.transaction.timeout=3600{code}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]
* [JCR system and default workspaces|#ADM.Configuration.JCR_Workspaces]
* [JCR|#ADM.Configuration.JCR]

h1. Mail server {anchor:id=ADM.Configuration.MailServer}

{note}
The *Mail* portlet and its services are deprecated. It remains fully supported for eXo customers, however it will not receive any enhancement and will be removed from the product scope in the future.
{note}

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 _$PLATFORM\_TOMCAT\_\HOME/
gatein/conf/configuration.properties_ if you are using Tomcat).

The relevant section looks like:

{code:java}#EMail
# Domain name: Help for sending links from email notifications. The default domain name is http://localhost:8080.
gatein.email.domain.url=http://localhost:8080
# Email display in "from" field of email notification.
gatein.email.smtp.from=noreply@exoplatform.com
gatein.email.smtp.username=
gatein.email.smtp.password=
gatein.email.smtp.host=smtp.gmail.com
gatein.email.smtp.port=465
gatein.email.smtp.starttls.enable=true
gatein.email.smtp.auth=true
gatein.email.smtp.socketFactory.port=465
gatein.email.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory{code}

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.

| {{{gatein.email.domain.url}}} | Domain name. |
| {{{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|http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html].

For Knowledge, you have to modify the following properties to the configuration file _/gatein/conf/configuration.properties_ to make sure that this mail service works with the authenticated SMTP systems:

{code:java}gatein.email.domain.url=http://localhost:8080
gatein.email.smtp.from=noreply@exoplatform.com{code}

{note}
The value of email address should be in a valid format.
{note}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]
* [Email-notification configuration for watching a document|#ADM.Configuration.Notification_email_config]

h1. Email-notification configuration for watching a document {anchor:id=ADM.Configuration.Notification_email_config}

eXo Platform 3.5 provides the *Watch document* function in *Sites Explorer* that allows you to receive email notifications of changes on your selected documents.

To customize the email notification, simply change the configuration in the _configuration.properties_ file.

*Files location*

|| File || Tomcat || JBoss ||
| _*configuration.properties*_ | _$PLARFORM\_TOMCAT\_HOME/gatein/conf/configuration.properties_ | _/server/default/conf/gatein/configuration.properties_ |

The relevant section looks like:
{code:java}# Email content for WatchDocumentService
gatein.ecms.watchdocument.sender=support@exoplatform.com
gatein.ecms.watchdocument.subject=Your watching document is changed
gatein.ecms.watchdocument.mimetype=text/html
gatein.ecms.watchdocument.content=<![CDATA[Dear $user_name,<br><br>The document $doc_name ($doc_title) has changed.<br>
<br>Please go to <a href="$doc_url">$doc_title</a> to see this change.<br><br>]]>{code}

*Details:*
||Property || Default value{anchor:id="watching-document-default-values"} || Description ||
|*gatein.ecms.watchdocument.sender*|support@exoplatform.com |The email address of the sender. |
|*gatein.ecms.watchdocument.subject* |Your watching document is changed|The subject of the notification email. |
|*gatein.ecms.watchdocument.mimetype*|text/html |The mimeType which is used to write the notification email. There are two types: *text/html* and *text/plain*. |
|*gatein.ecms.watchdocument.content* |<!\[CDATA\[Dear $user\_name,<br><br>The document $doc\_name ($doc\_title) has changed.<br><br>Please go to <a href="$doc\_url">$doc\_title</a> to see this change.<br><br>\]\]>|The content of the notification email. |

At present, eXo Platform provides 4 parameters below in the *gatein.ecms.watchdocument.content* property of the email:
* *$user\_name*: The full name of the receiver.
* *$doc\_name*: The name of the document.
* *$doc\_title*: The title of the document.
* *$doc\_url*: The link to view the document in *Sites Explorer*.
{note}
If the values above are not set in the _configuration.properties_ file, the server will use the [default values|#watching-document-default-values] defined in an _.xml_ file.
{note}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]
* [Mail server|#ADM.Configuration.MailServer]

h1. WebDAV cache control {anchor:id=ADM.Configuration.WedDAV_cache_control}

The embedded WebDAV server lets you control the cache-control HTTP header that transmits to clients by the MIME type.
This is useful for fine-tuning your website.

The configuration property is _exo.webdav.cache-control_.

{code}exo.webdav.cache-control=text/*:max-age=3600;image/*:max-age=1800;*/*:no-cache;{code}

The property expects a comma-separated list of key=pair values, where keys are a list of MIME types followed by the cache-control value to set.

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]
* [Cache configuration|#ADM.Configuration.CacheConfiguration]

h1. Chat server {anchor:id=ADM.Configuration.Chat_Server}
{note}
The *Chat* portlet and its services are deprecated. It remains fully supported for eXo customers, however it will not receive any enhancement and will be removed from the product scope in the future.
{note}

{docbook}
<para xml:id="ADM.Configuration.XMPPMessenger">
<citetitle>
<emphasis role="bold">
XMPPMessenger
</emphasis>
</citetitle>
</para>
{docbook}

If you change the host name and port for the Chat server, you will need to edit two properties:

{code}# IP or hostname for the eXo Chat XMPP server
exo.chat.server=127.0.0.1

# TCP port for where the eXo Chat server listens for XMPP calls
exo.chat.port=5222{code}

{docbook}
<para xml:id="ADM.Configuration.Chat_server_configuration">
<citetitle>
<emphasis role="bold">
Chat server configuration
</emphasis>
</citetitle>
</para>
{docbook}

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:

{code:xml}<prop>
  <name>
    <is>
      <blah>value</blah>
    </is>
  </name>
</prop>{code}


Openfire has an extensive list of configuration properties. Please read the list of all properties in [Openfire documentation | http://community.igniterealtime.org/docs/DOC-1061] 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 |

{anchor:id="ADM.Configuration.Ports"}
*Ports*: 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. |

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]

h1. Office server {anchor:id=ADM.Configuration.Office_server}
eXo Platform allows users to view various types of documents directly in the *Sites Explorer* through the office server. To do so, the office application must be available in your local device first.

Since eXo Platform 3.5.4, this service has been manually enabled/disabled by setting value of the *wcm.jodconverter.enable* parameter in _configuration.properties_.
- *true*: Activate JODConverter service. It's the default value when this parameter is missing.
- *false*: Deactivate JODConverter service. This service maybe does not work in several environment like Microsoft Windows. The performance is also gained when Office service is turned off.
 
*JODConverter* will use the [default values|#default_values] below to start the office server.

You can customize the default values by adding the properties below in the _configuration.properties_ file:

{code}# JODConverter 3.0
wcm.jodconverter.portnumbers=8100,8101,8102,8103,8104
wcm.jodconverter.officehome=/usr/lib/libreoffice
wcm.jodconverter.taskqueuetimeout=30000
wcm.jodconverter.taskexecutiontimeout=120000
wcm.jodconverter.maxtasksperprocess=200
wcm.jodconverter.retrytimeout=120000{code}


||Key || Default value{anchor:default_values} || Description ||
|wcm.jodconverter.portnumbers |2002|List of ports, separated by commas, those used by each JODConverter processing thread. The number of office instances is equal to the number of ports. |
|wcm.jodconverter.officehome|See [here|#Office_home] |The absolute path to the office home on the current local device. It means that the office needs to be installed in the local device before using it. |
|wcm.jodconverter.taskqueuetimeout |30000 |The maximum living time of a task in the conversation queue. The task will be removed out of the queue if the waiting time is longer than _taskQueueTimeout_. |
|wcm.jodconverter.taskexecutiontimeout |120000 |The maximum time to process a task. If the processing time of a task is longer than _taskExecutionTimeout_, this task will be aborted and the next task is processed. |
|wcm.jodconverter.maxtasksperprocess |200 |The maximum number of tasks are processed. |
|wcm.jodconverter.retrytimeout|120000 |The interval time to try to restart the office services after an unexpected crash. |


*The default office home* {anchor:id="Office_home"}
* *Linux*
{code}"/opt/openoffice.org3"
"/opt/libreoffice"
"/usr/lib/openoffice"
"/usr/lib/libreoffice"{code}

* *Windows*
{code}"<SYSTEM_PROGRAMFILES>/OpenOffice.org 3"
"<SYSTEM_PROGRAMFILES>/LibreOffice 3"{code}

* *Mac*
{code}"/Applications/OpenOffice.org.app/Contents"
"/Applications/LibreOffice.app/Contents"{code}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]

h1. Logs {anchor:id=ADM.Configuration.Logs}

The logs of eXo Platform are controlled by the [Java Logging API|http://docs.oracle.com/javase/6/docs/technotes/guides/logging/index.html].

By default, the logs are configured to:

* log errors and warnings on the console.
* log _/gatein/logs/gatein-YYYY-MM-DD.log_.

In Tomcat, the logs are configured via the _conf/logging.properties_ file. Please refer to [Tomcat's Logging Documentation|http://tomcat.apache.org/tomcat-6.0-doc/logging.html] for more information on how to adjust this file to your needs.

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]

h1. JCR {anchor:id=ADM.Configuration.JCR}

The set of properties controls the JCR behaviour.

{code}# Type of JCR configuration to use. Possible values are:
# local : local JBC configuration
# cluster : cluster JBC configuration
gatein.jcr.config.type=local

....

# JCR dialect.
# auto : enabled auto detection
gatein.jcr.datasource.dialect=auto

# JCR Session Registry configuration
# Define here the Max Age of the JCR Session in the session registry (in seconds)
gatein.jcr.sessionregistry.sessionmaxage=300

# JCR cache configuration
gatein.jcr.cache.config=file:${gatein.conf.dir}/jcr/jbosscache/${gatein.jcr.config.type}/cache-config.xml
gatein.jcr.cache.expiration.time=15m

# JCR Locks configuration
gatein.jcr.lock.cache.config=file:${gatein.conf.dir}/jcr/jbosscache/${gatein.jcr.config.type}/lock-config.xml

# JCR Index configuration
gatein.jcr.index.cache.config=file:${gatein.conf.dir}/jcr/jbosscache/${gatein.jcr.config.type}/indexer-config.xml

# JGroups configuration
# for eXo Cache and IDM org-service (in cluster cache-config.xml files)
gatein.jgroups.config=${gatein.conf.dir}/jgroups/jgroups-udp.xml
# for JCR
gatein.jcr.jgroups.config=file:${gatein.jgroups.config}{code}

*Details:*

| *{{gatein.jcr.config.type}}* | Set to *cluster* if you want to use eXo Platform in the cluster mode. Otherwise, leave *local*. |
| *{{gatein.jcr.cache.config}}* | Path to the JBoss Cache configuration for the JCR cache. |
| *{{gatein.jcr.cache.expiration.time}}* | JCR cache expiration time. |
| *{{gatein.jcr.lock.cache.config}}* | Path to the JBoss Cache configuration for the JCR lock. |
| *{{gatein.jcr.index.cache.config}}* | Path to the JBoss Cache configuration for the JCR index. |
| *{{gatein.jgroups.config}}* | Path to the JGroups configuration to use for the cluster mode of eXo Cache and PicketLink IDM organization service (see below in _IDM caches_). |
| *{{gatein.jcr.jgroups.config}}* | Path to the JGroups configuration to use for the cluster mode. |

For more details on configuring these files, please refer to the [eXo JCR Reference Guide|../../reference/html/JCRReferenceGuide.html].

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]

h1. Cache configuration {anchor:id=ADM.Configuration.CacheConfiguration}

{docbook}
<para xml:id="ADM.Configuration.CacheConfiguration.PortalCacheConfig">
<citetitle>
<emphasis role="bold">
Portal Cache Configuration
</emphasis>
</citetitle>
</para>
{docbook}

{code}# Portal Cache Configuration - TemplateService
cache.exo.portal.TemplateService.capacity=3000
cache.exo.portal.TemplateService.liveTime=600

# Portal Cache Configuration - ResourceBundleData
cache.exo.portal.ResourceBundleData.capacity=3000
cache.exo.portal.ResourceBundleData.liveTime=600

# Portal Cache Configuration - MOPSessionManager
cache.exo.portal.MOPSessionManager.Capacity=5000
cache.exo.portal.MOPSessionManager.TimeToLive=600{code}

||Cache Name||Description||
|{{TemplateService}}|Cache all Groovy templates of portal by its template path and ResourceResolver.|
|{{ResourceBundleData}}|Cache all resource bundles by name and locale.|
|{{MOPSessionManager}}|Cache all model objects of portal by storageId, such as pages, navigations, and preferences.|

{docbook}
<para xml:id="ADM.Configuration.CacheConfiguration.SocialCacheConfig">
<citetitle>
<emphasis role="bold">
Social Cache Configuration
</emphasis>
</citetitle>
</para>
{docbook}

{code}# Social Cache Configuration - IdentityCache
cache.exo.social.IdentityCache.Capacity:300
cache.exo.social.IdentityCache.TimeToLive:-1

# Social Cache Configuration - IdentityIndexCache
cache.exo.social.IdentityIndexCache.Capacity:300
cache.exo.social.IdentityIndexCache.TimeToLive:-1

# Social Cache Configuration - ProfileCache
cache.exo.social.ProfileCache.Capacity:300
cache.exo.social.ProfileCache.TimeToLive:-1

# Social Cache Configuration - IdentitiesCountCache
cache.exo.social.IdentitiesCountCache.Capacity:2000
cache.exo.social.IdentitiesCountCache.TimeToLive:86400

# Social Cache Configuration - IdentitiesCache
cache.exo.social.IdentitiesCache.Capacity:2000
cache.exo.social.IdentitiesCache.TimeToLive:86400

# Social Cache Configuration - RelationshipCache
cache.exo.social.RelationshipCache.Capacity:10000
cache.exo.social.RelationshipCache.TimeToLive:-1

# Social Cache Configuration - RelationshipFromIdentityCache
cache.exo.social.RelationshipFromIdentityCache.Capacity:10000
cache.exo.social.RelationshipFromIdentityCache.TimeToLive:-1

# Social Cache Configuration - RelationshipsCountCache
cache.exo.social.RelationshipsCountCache.Capacity:800
cache.exo.social.RelationshipsCountCache.TimeToLive:-1

# Social Cache Configuration - RelationshipsCache
cache.exo.social.RelationshipsCache.Capacity:800
cache.exo.social.RelationshipsCache.TimeToLive:-1

# Social Cache Configuration - ActivityCache
cache.exo.social.ActivityCache.Capacity:6000
cache.exo.social.ActivityCache.TimeToLive:-1

# Social Cache Configuration - ActivitiesCountCache
cache.exo.social.ActivitiesCountCache.Capacity:4000
cache.exo.social.ActivitiesCountCache.TimeToLive:-1

# Social Cache Configuration - ActivitiesCache
cache.exo.social.ActivitiesCache.Capacity:4000
cache.exo.social.ActivitiesCache.TimeToLive:-1

# Social Cache Configuration - SpaceCache
cache.exo.social.SpaceCache.Capacity:100
cache.exo.social.SpaceCache.TimeToLive:-1

# Social Cache Configuration - SpaceRefCache
cache.exo.social.SpaceRefCache.Capacity:400
cache.exo.social.SpaceRefCache.TimeToLive:-1

# Social Cache Configuration - SpacesCountCache
cache.exo.social.SpacesCountCache.Capacity:2000
cache.exo.social.SpacesCountCache.TimeToLive:86400

# Social Cache Configuration - SpacesCache
cache.exo.social.SpacesCache.Capacity:2000
cache.exo.social.SpacesCache.TimeToLive:86400
{code}

||Cache Name||Description||
|{{IdentityCache}}| Cache identity by _IdentityKey_ (based on the identity ID) . |
|{{IdentityIndexCache}}| Cache identity index by _IdentityCompositeKey_ (based on the provider ID and the remote ID). |
|{{ProfileCache}}| Cache profile by _IdentityKey_ (based on the identity ID). |
|{{IdentitiesCountCache}}| Cache identity count by _IdentityFilterKey_ (based on the provider ID, remote ID, name, positon, company, skills, first character of the identity, and the List<IdentityKey>). |
|{{IdentitiesCache}}| Cache identity list by _ListIdentitiesKey_ (based on IdentityFilterKey, offset, limit). |
|{{RelationshipCache}}| Cache relationship by _RelationshipKey_ (based on the ID of the relationship). |
|{{RelationshipFromIdentityCache}}| Cache relationship key  by _RelationshipIdentityKey_ (based on the identity ID of 2 users which have relationship). |
|{{RelationshipsCountCache}}| Cache relationship count by _RelationshipCountKey_. |
|{{RelationshipsCache}}| Cache list identity wich have relation by _ListRelationshipsKey_. |
|{{ActivityCache}}| Cache activity by ActivityKey (based on the activity ID). |
|{{ActivitiesCountCache}}| Cache count of activities by activity ID, identity ID (the identity who makes request) and the type of activity.|
|{{ActivitiesCache}}| Cache activities list by _ListActivitiesKey_.|
|{{SpaceCache}}| Cache space by _SpaceKey_ (based on the space ID). |
|{{SpaceRefCache}}| Cache ref space by _SpaceRefKey_ (base on the display name, pretty name, group ID and the space URL). |
|{{SpacesCountCache}}| Cache spaces count by _spaceFilterKey_ (based on the user ID, the first character of space name, the space name search condition, and space type (MEMBER,PENDING,INVITED,PUBLIC,ACCESSIBLE, VISIBLE, EDITABLE, ALL)). |
|{{SpacesCache}}| Cache list space by _ListSpacesKey_ (based on _SpaceFilterKey_, offset and limit). |

{docbook}
<para xml:id="ADM.Configuration.CacheConfiguration.ECMSCacheConfig">
<citetitle>
<emphasis role="bold">
ECMS Cache Configuration
</emphasis>
</citetitle>
</para>
{docbook}

{code}# ECMS Cache Configuration - Viewer
cache.exo.ecms.Viewer.PDFViewer.Capacity=300
cache.exo.ecms.Viewer.PDFViewer.TimeToLive=3600

# ECMS Cache Configuration - Drives
cache.exo.ecms.Drives.ManageDrive.Capacity=300
cache.exo.ecms.Drives.ManageDrive.TimeToLive=86400

# ECMS Cache Configuration - Scripts
cache.exo.ecms.Scripts.ScriptService.Capacity=300
cache.exo.ecms.Scripts.ScriptService.TimeToLive=86400

# ECMS Cache Configuration - Templates
cache.exo.ecms.Templates.TemplateService.Capacity=300
cache.exo.ecms.Templates.TemplateService.TimeToLive=86400

# ECMS Cache Configuration - Webcontent
cache.exo.ecms.Webcontent.InitialWebContentPlugin.Capacity=300
cache.exo.ecms.Webcontent.InitialWebContentPlugin.TimeToLive=600

# ECMS Cache Configuration - WCM Composer
cache.exo.ecms.WCMComposer.Capacity=1000
cache.exo.ecms.WCMComposer.TimeToLive=3600{code}

||Cache Name||Description||
|{{PDFViewerREST}}|Cache data of PDF files by the ObjectKey object.|
|{{ManageDrive}}|Cache all drives of Sites Explorer by the drive group name (String constant).|
|{{ScriptService}}|Cache all Groovy script files by the script name.|
|{{TemplateService}}|Cache all Groovy templates by the mechanism of org.exoplatform.groovyscript. text.TemplateService.|
|{{InitialWebContentPlugin}}|Cache all artifact data by sourcePath of deploymentDescriptor. These data are reused when a new portal is deployed.|
|{{WCMComposer}}|Cache published contents by the hash generated from path, version, remoteUser, language, recursive, orderBy, orderType, primaryType of cached nodes in Content.|

{note}
To further understand about the cache configuration, refer to the [Cache Levels|#GadgetUserguide.ManagementMonitoringGadget.CacheLevels] content in [eXo Platform User Guide|../../../user-guide/html/UserGuide.html]
and the [Cache management view|#ADM.Management.Cache_management_view] section in this document.
{note}

{docbook}
<para xml:id="ADM.Configuration.CacheConfiguration.PageRenderingCache">
<citetitle>
<emphasis role="bold">
PageRenderingCache Configuration
</emphasis>
</citetitle>
</para>
{docbook}

{code}# Page rendering cache setting
cache.exo.wiki.PageRenderingCache.Capacity=1000
cache.exo.wiki.PageRenderingCache.TimeToLive=-1{code}
{docbook}
<para> </para>
{docbook}

||Cache Name||Description||
|{{PageRenderingCache}}| Cache a rendered content of a wiki page. |

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]
* [Users configuration|#ADM.Configuration.Users_configuration]
* [Gadget configuration|#ADM.Configuration.Gadget_configuration]

h1. Users configuration {anchor:id=ADM.Configuration.Users_configuration}

{docbook}
<highlights>
        <itemizedlist>
          <listitem>
            <para>
              <link linkend="ADM.Configuration.Super_user_configuration">Super-user configuration</link>
            </para>
			<para>
			Definition of a super-user and the way to set a user account as the super-user.
			</para>
          </listitem>
          <listitem>
            <para>
              <link linkend="ADM.Configuration.Users_configuration.Grant_access_toolbar">Grant users access to toolbar</link>
            </para>
			<para>
			Steps to grant users access to toolbar in 2 usecases: access to toolbar but not CMS, and access to both the toolbar and the underlying CMS implementation.
			</para>
		  </listitem>
		</itemizedlist>
</highlights>
{docbook}

{note}
In eXo Platform, the default users, excluding Super-admin user, are defined in "Acme WebSite" and "Office Intranet" extensions. By deleting those extensions, the users "john", "demo", "james" and "mary" will not be created.
{note}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]

h2. Super-user configuration {anchor:id=ADM.Configuration.Super_user_configurationRoleNotInToc}

Super-user is a special user who has full privileges and can do anything. However, only one user account may be declared as the super-user.
By default, the super-user is set to the "_root_" user. The "_root_" user is preconfigured as below:
* Account details: Root, Root, root@localhost.
* Memberships: _member\:/organization/management/executive-board_, _\*:/platform/administrators_, _\*:/platform/users_, _\*:/platform/web-contributors_, _\*:/organization/employees_.
* All permissions on folders and other users.
* Permission to use some locked features in eXo Platform.

For example, if you want to set a user account as the super-user, you can configure it as follows:
{note}
You must do this configuration before the first boot of eXo Platform.
{note}

*1.* Modify the system property named _exo.super.user_ defined in _configuration.properties_ before starting eXo platform.
{code:java}# Super User declaration
exo.super.user=root{code}

*2.* Make sure the user whom you want to set as the "super-user" already exists into your configuration. By default, the users including "john", "demo", "james" and "mary" are created.

*3.* Remove the "root" user declaration defined in the _organization-configuration.xml_ file:

{code:xml}<field name="user">
  <collection type="java.util.ArrayList">
    <value>
      <object type="org.exoplatform.services.organization.OrganizationConfig$User">
        <field name="userName">
          <string>${exo.super.user}</string>
        </field>
        <field name="password">
          <string>gtn</string>
        </field>
        <field name="firstName">
          <string>Root</string>
        </field>
        <field name="lastName">
          <string>Root</string>
        </field>
        <field name="email">
          <string>root@localhost</string>
        </field>
        <field name="groups">
          <string>*:/platform/administrators,*:/platform/users,*:/platform/web-contributors,*:/organization/employees
          </string>
        </field>
      </object>
    </value>
  </collection>
</field>{code}

*4.* Add some privileges to your user into the _organization-configuration.xml_ file.

*Files location*

|| File || Tomcat || JBoss||
| _*organization-configuration.xml*_ | _$PLATFORM\_TOMCAT\_HOME/webapps/platform-extension/WEB-INF/conf/organization/_ |  _$PLATFORM\_JBOSS\_HOME/default/deploy/exo-platform-extension-$PLF\_Version.ear/WEB-INF/conf/organization/_ |

*For example:*
* Set the "demo" user as a super-user.
{code:java}# Super User declaration
exo.super.user=demo{code}
* Assign some privileges to the "demo" user:
{code:xml}<value>
    <object type="org.exoplatform.services.organization.OrganizationConfig$User">
      <field name="userName">
        <string>demo</string>
      </field>
      <field name="password">
        <string>gtn</string>
      </field>
      <field name="firstName">
        <string>Jack</string>
      </field>
      <field name="lastName">
        <string>Miller</string>
      </field>
      <field name="email">
        <string>jack.miller@acme.exoplatform.com</string>
      </field>
      <field name="groups">
        <string>*:/platform/administrators,*:/platform/users,*:/platform/web-contributors,*:/organization/employees</string>
      </field>
    </object>
</value>{code}

h2. Grant users access to toolbar  {anchor:id=ADM.Configuration.Users_configuration.Grant_access_toolbarRoleNotInToc}
{include:document=accesstoolbar.wiki|syntax=confluence/1.0}

h1. Gadget configuration {anchor:id=ADM.Configuration.Gadget_configuration}
{docbook}
<para xml:id="ADM.Configuration.Gadget_OAuth_configuration">
<citetitle>
<emphasis role="bold">
Default OAuth key configuration
</emphasis>
</citetitle>
</para>
{docbook}
In eXo Platform, OAuth gadgets use a OAuth key to authorize with external service providers.
There is always a default key defined in the _oauthkey.pem_ file.
This key will be used in case the OAuth gadgets do not indicate a key.
It is strongly recommended that you create your own _oauthkey.pem_ file by using the *openssl* tool and some commands as follows:

{code}openssl req -newkey rsa:1024 -days 365 -nodes -x509 -keyout testkey.pem -out testkey.pem -subj '/CN=mytestkey'
openssl pkcs8 -in testkey.pem -out oauthkey.pem -topk8 -nocrypt -outform PEM{code}

After creating the new _oauthkey.pem_ file, you can use it to replace the default _oauthkey.pem_ file in the _data/gadgets/_ folder.

*Files location*

||File||Tomcat||JBoss||
|_*oauthkey.pem*_|_$PLATFORM\_TOMCAT\_HOME/gatein/gadgets_|_$PLATFORM\_JBOSS\_HOME/server/<PROFILE>/data/gadgets_|

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]

h1. Other properties {anchor:id=ADM.Configuration.Other_properties}

{code}# navigation controller file
gatein.portal.controller.config=${gatein.conf.dir}/controller.xml

# global portlet.xml
gatein.portlet.config=${gatein.conf.dir}/portlet.xml

# JNDI Name of the IDM datasource
# portal name will be appended to this name before the JNDI lookup
# example : java:/comp/env/exo-idm in "portal" portal will result in a JNDI lookup on context : java:/comp/env/exo-idm_portal 
gatein.idm.datasource.name=java:exo-idm
# Optional database schema for use with IDM tables (empty by default), uncomment this line to specify required schema name
#gatein.idm.datasource.schema=EXO1

# IDM 
gatein.portal.idm.createuserportal=false
gatein.portal.idm.destroyuserportal=true

# IDM caches
gatein.idm.api.cache.config=file:${gatein.conf.dir}/idm/jbosscache/${gatein.jcr.config.type}/api-cache-config.xml
gatein.idm.store.cache.config=file:${gatein.conf.dir}/idm/jbosscache/${gatein.jcr.config.type}/store-cache-config.xml

# Key files for gadget
gatein.gadgets.securitytokenkeyfile=${exo.shared.dir}/gadgets/key.txt
gatein.gadgets.signingkeyfile=${exo.shared.dir}/gadgets/oauthkey.pem{code}

{docbook}
<para>
<prompt>
    <emphasis role="bold">See also</emphasis>
</prompt>
</para>
{docbook}
* [eXo Platform configuration|#ADM.Configuration.eXo_Configuration]
* [Database configuration|#ADM.Configuration.Database_Configuration]
* [File system paths|#ADM.Configuration.File_system_paths]
