Starting with basic configuration

Now that you have planned your implementation, you can start configuring Alfresco as per your business needs. This section covers basic configuration settings such as e-mail server, look and feel, and multilingual support, as required before using the system.

Extending Alfresco configuration

Alfresco configuration items are completely exposed as XML files, so you can override the default out-of-the-box Alfresco configuration items by customizing individual configuration items.

Alfresco ConfigRoot folder

The default configuration files for Alfresco are in the application WAR file. When the server starts, the files are expanded to <configRoot>, which is either:

JBoss: <JBOSS_HOME>/server/default/tmp/deploy/tmp*alfresco-exp.war/WEBINF/classes

or

Tomcat: <TOMCAT_HOME>/webapps/alfresco/WEB-INF/classes

The default configuration files, maintained by Alfresco, are contained in the tomcat/webapps/alfresco/WEB-INF/classes/alfresco folder. The repository properties file (repository.properties) in this folder defines some of the core system properties including the following properties:

  • dir.root: This is the folder (alf_data) where the binary content and Lucene indexes are stored. It is relative by default, but should be pointed to a permanent, backed-up location for permanent data storage.
  • db.*: These are the default database connection properties.

The web client configuration files are located in web client *.xml files. Examine the other configuration files in the tomcat/webapps/alfresco/WEB-INF/classes/alfresco folder.

Alfresco extension folder

You can override or extend the Alfresco configuration by placing the custom configuration files in the <extension> folder. If you have downloaded one of the bundles, you will find the sample files at the following location:

  • JBoss: <alfresco>/jboss/server/default/conf/alfresco/extension
  • Tomcat: <alfresco>/tomcat/shared/classes/alfresco/extension
Configuration approach

When Alfresco starts, it reads all the default configuration files, and then reads the customized configuration items (in the extension folder). So, depending upon the type of item, the customization either extends, or overrides the default configuration item.

The following example extends the advanced search form. The first file contains the default configuration. This file can be found in the folder from the path tomcat/webapps/alfresco/WEB-INF/classes/alfresco/web-client-config.xml.

<alfresco-config>
...
...
  <config evaluator="string-compare" condition="Advanced Search">
    <advanced-search>
      <custom-properties>
        <meta-data aspect="rma:filePlan"
                             property="rma:recordCategoryName" />
        <meta-data aspect="rma:filePlan"
                       property="rma:recordCategoryIdentifier" />
        <meta-data aspect="rma:record"
                               property="rma:recordIdentifier" />
        <meta-data aspect="rma:record"
                                      property="rma:orginator" />        
      </custom-properties>
    </advanced-search>
  </config>
...
...
</alfresco-config>

The web client configuration file in the extension folder (located at tomcat/common/classes/alfresco/extension/web-client-config-custom.xml) adds an additional property called cm:effectivity to the advanced search form.

  <alfresco-config>
    <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
        <custom-properties>
          <meta-data aspect= "cm:effectivity" property="cm:to" />
        </custom-properties>
      </advanced-search>
    </config>
</alfresco-config>

Web client configuration files can contain configuration that either augments the standard configuration or replaces it.

Replacement is performed at the config level by adding a replace= true attribute to the configuration element, for example:

   <config evaluator="xx" condition="yy" replace="true">

Any configuration found within a section marked this way will replace any configuration found in the Alfresco maintained files. For example, if you wanted to replace the list of languages shown in the login page, you could add the following code:

   <config evaluator="string-compare" condition="Languages" 
      replace="true">
      <languages>
         <language locale="fr_FR">French</language>
         <language locale="de_DE">German</language>
      </languages>
   </config>

On the other hand if you just wanted to add French to the list of languages, you would add the following code:

   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="fr_FR">French</language>
      </languages>
   </config>

Whenever you make changes to these configuration files in the extension folder, you need to restart Alfresco to see the effect of the changes.

Alfresco also provides the Web Client Administration console to dynamically deploy the web client configuration. With dynamic deployment there is no need to restart the server. More details about the dynamic approach are provided in Chapter 7, Extending Alfresco Content Model.

Packaging and deploying Java extensions

If your customization only consists of Alfresco configuration files or properties files, that is, web-client-config-custom.xml or webclient.properties, then you can place the customization files in the extension folder.

However, if you are changing the Java source code, the process is a little different. Java classes are typically packaged within a .jar file; this then has to go in the web application's WEB-INF/lib folder. If you have Java code, you are more than likely going to have at least one other file as part of your extension, that is, configuration files. These too can be contained within the .jar file, simply package them within the .jar file in the alfresco/extension folder.

Another alternative is to add your .jar file to the alfresco.war file. In JBoss, if you deploy a web application as a WAR file, the application gets exploded to a temporary folder each time the application server starts. Thus there is nowhere to copy the .jar file to. One solution is to use an exploded deployment. Create a folder called alfresco.war under the deploy folder and extract the contents of alfresco.war (the file) into it. Then copy your .jar file to deploy/alfresco.war/WEB-INF/lib and restart JBoss.

Installing the enterprise license file

If you have installed the enterprise version of Alfresco, then you have to install the enterprise license file. Otherwise by default the Alfresco enterprise software expires in 30 days after installation.

Get the .lic file from Alfresco. Copy the .lic file to the shared/classes/alfresco/extension/license folder (for example, for Tomcat it is tomcat/shared/classes/extension/license). With fresh installation you don't have the license folder, you need to create the folder. Once in place, restart the Alfresco server. Information about the license being set will be visible in the logs; also the license file is renamed with .installed. The Administration Console within Alfresco also gives details of the license status.

Changing the default administrator password

Administrator is the super user of the system. The administrator user ID is admin, and the password is also admin. The following are the different ways to change the default administrator password

  • At the time of installation using Installer setup wizard
  • Updating the web client configuration file in the extensions folder with the following code:
         <admin>
             <initial-password>admin</initial-password>
          </admin>
  • Log in to Alfresco as admin user and change the password

Configuring the content store

Alfresco stores the content (binary files) and search indexes in file system. By default, on Windows platform, this location is the <tomcat_install>/alf_data folder.

You can manage the file system storage locations by editing the alfresco-global.properties file in the tomcat/shared/classes/ folder. The main property to edit is dir.root, which points to the file repository location.

If these properties are not listed in your alfresco-global.properties file, then copy these properties from the tomcat/webapps/alfresco/WEB-INF/classes/repository.properties file into the tomcat/shared/classes/alfresco-global.properties file and edit accordingly.

For example:

dir.root=C:/Alfresco/alf_data
Tip

You must use forward slashes for all operating systems

The best practice is to use an absolute path such as ./alf_data to avoid confusion.

Configuring logfiles

Logfiles hold very important runtime system information. For Tomcat installation, the logfiles are located at <install_folder> itself. Tomcat application server creates a logfile per day. The current logfile is named alfresco.log and at the end of the day, the logfile will be backed up as alfresco.log.YYYY-MM-DD (for example, alfresco.log.2008-12-22).

You can configure the logfile by creating a new custom log4j.proprties file in the tomcat/shared/classes/alfresco/extension folder and make your logger entries. Your filename should always end with the suffix –log4j, for example xxx-log4j.properties. Custom log4j file overrides the default configuration provided in the log4j.properties file in tomcat/webapps/alfresco/WEB-INF/classes.

The following is the sample logger entry in the custom log4j file.

log4j.logger.org.alfresco.util.exec.RuntimeExec=debug

You can set the level of logging as either info, debug, or error, based on the amount of information you need (for example, log4j.logger.org.alfresco.web=info). For example, the option debug will provide you very detailed information; however, it creates performance issues in high traffic installations.

Configuring default logos

While using the Alfresco Explorer, you would have noticed the Alfresco logo appearing in login page, and in web client toolbar as shown in the following screenshots. You can configure custom logos as per your branding requirements.

All the logos that appear in the web client application are kept in the logo's folder in the file system. In Tomcat installation, the logo's folder is <install_folder>\tomcat\webapps\alfresco\images\logo.

Examine some of the logos in this folder:

  • AlfrescoLogo32.png: This is the site logo. This logo is displayed always at the top-left corner of the Alfresco Explorer. This logo is 32 pixels wide and 30 pixels high.
  • AlfrescoLogo200.png: This is the login page logo. This logo is displayed in the login page in the login window along with username and password. This logo is 200 pixels wide and 60 pixels high.
  • AlfrescoFadedBG.png: This is the login page background logo. This is the blurred logo displayed as background image in the login page. This logo is 428 pixels wide and 422 pixels high.

To customize these logos, first rename the existing logos to AlfrescoLogo32_OLD.png, AlfrescoLogo200_OLD.png, and AlfrescoFadedBG_OLD.png respectively, for backup purposes. Create three new logos with the original names with the same sizes. For example, a custom site logo with the filename as AlfrescoLogo32.png (32 x 30 pixels size).

Now your Alfresco application displays new custom logos, instead of the default old ones. In some browsers you might not be able to see the new logos due to the fact that the old logos are cached in the browser. Refresh the browser cache to view the new logos in Alfresco Explorer.

Customizing the look and feel using CSS

Cascading Style Sheets (CSS) files define how to display HTML elements, in other words, the look and feel of Alfresco Explorer. The font size, font color, background color, font style, text alignment, and table structure, everything is controlled by the CSS files.

The CSS files are located in the file system <install_folder>\tomcat\webapps\alfresco\css folder. You can customize the look and feel by changing the values in the main.css file. For example, you can customize the title look and feel by editing the following block in the main.css file:

headbarTitle
  {
    color: #003366;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
  }
Note

It is a good practice to back up the main.css file before making any changes to it.

Directly modifying the files in Alfresco WAR folder is not a good way. As part of best practice you should deploy any changes to Alfresco using the AMP (Alfresco Module Package) file. With the use of AMP, it gets easier to revert back any changes. More details about packaging the files in AMP and deploying AMP file is provided at https://wiki.alfresco.com/wiki/AMP_Files.

Configuring multilanguage support

You can configure Alfresco to support various languages such as:

  • Chinese
  • Dutch
  • English
  • French
  • German
  • Italian
  • Japanese
  • Russian
  • Spanish

The support for other languages is being developed. The beauty of a true open-source development is that most of these language packs are developed and donated by community users.

The following are the steps to configure a specific language support for your Alfresco application:

  1. Download Alfresco language packs from Alfresco add-ons site, http://addons.alfresco.com/search/node/language. (Alfresco's official language translations are managed by the collaborative tool CrowdIn (http://crowdin.net/project/alfresco).)
  2. Copy the required language packs to the tomcat/shared/classes/alfresco/messages folder in the file system.
  3. Edit the web-client-config-custom.xml file in the extensions folder and include the following XML code to configure the specific languages:
    <!-- English is the default language.  Add additional languages to
        the list in the login page -->
      <config evaluator="string-compare" condition="Languages">
        <languages>
          <language locale="de_DE">German</language>
          <language locale="es_ES">Spanish</language>
          <language locale="fr_FR">French</language>
          <language locale="it_IT">Italian</language>
          <language locale="ja_JP">Japanese</language>
        </languages>
      </config>
  4. Restart Alfresco.

Alfresco web client login screen displays all the configured languages in the drop-down list. The languages appear in the login option and will be in the same order as they are defined in the configuration file. Select the language of your choice as shown in the following screenshot:

Configuring subsystems

Subsystems, as the term suggests, are independent components embedded within Alfresco. Each subsystem wraps a functional module of Alfresco, for example, authentication function is designed as one of the subsystems in Alfresco. Each subsystem has its own separate Spring Application Context and configuration file, which leverage us to start, stop, or configure the subsystem without affecting the main server. Subsystem can have multiple instances of implementation.

A few main subsystems are as follows:

  • Authentication
  • File server
  • Audit
  • Third party
  • Email

Each subsystem has category and type:

  • category: It describes functionality of the subsystem, for example, email.
  • type: It should be a name for the specific implementation of subsystem. For example, authentication has various types of implementations, such as ldap and kerberos. Subsystem with single implementation defines default as type.

Default configuration of subsystem is located at <install_folder>\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\subsystem\<category>\<type>.

For example, all files for authentication subsystem with LDAP will be located at <install_folder>\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\subsystem\Authentication\ldap.

Each subsystem folder mainly has *-context.xml and *.properties configuration files. These files will be loaded by the subsystem's application context.

Subsystem works as an abstract system, it hides its implementation. In Alfresco, main server accesses the subsystem by mounting them. This is achieved with declaration of bean with the ChildApplicationContextFactory class. Instance of this class encloses the Spring Application Context of subsystems.

For example, GoogleDocs subsystem is mounted to main server using the following bean definition in the bootstrap-context.xml (<install_folder>\tomcat\webapps\alfresco\WEB-INF\classes\alfresco) file. The id of the bean is the category of subsystem:

<bean id="googledocs" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
        <property name="autoStart">
            <value>true</value>
        </property>
    </bean>

You would have folder with name as category within subsystems <install_folder>\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\subsystem\googledocs.

Extending any subsystem

For extending the subsystem you can perform the following steps as per your requirements:

  • For configuration of any subsystem properties, add your changes in the alfresco-global.properties file at <install_folder>\tomcat\shared\classes, or this can be done via JMX, which you will learn in Chapter 14, Administering and Maintaining the System. After change in the alfresco-global.properties file, restart Alfresco.
  • In case you need a separate properties file for each subsystem, place your properties file at <extension>/subsystems/<category>/<type>/<id>/*.properties. Let's take the example of FileServer subsystem. It doesn't have multiple implementations, so type and id of such system is default. We place our files at <extension>/subsystems/fileServers/default/default/custom-fileserver.properties.
  • To extend any configuration create a custom context file and place it at <extension>/subsystems/<category>/<type>/<id>/*-context.xml. For file servers subsystem, any configuration of beans would go into <extension>/subsystems/fileServers/default/default/custom-fileserver-context.xml.
Configuring the audit subsystem

Your content could be one of your most valuable assets. Based on the regulatory and compliance requirements, you might want to have a full audit trail and accountability of user activities in your content management system. Auditing subsystem helps you to achieve this in Alfresco. All user and system activities are logged and made available through the server auditing system.

Auditing system has the following main components:

  • Data Producer: This component defines components which would generate data that might be used for auditing, irrespective of whether it would be stored or not.
  • Audit Filter: This component filters out the data generated by Data Producer for auditing based on the filter parameters. We can configure these filters.
  • Data Extractor and Generator: This component extracts the filtered data and generates it in a format required to be stored.

Let's learn how we can configure audit.

Enable audit

To enable auditing, add the following highlighted property in the alfresco-global.properties file.

audit.enabled=true

(This property enables the audit framework in Alfresco, which is by default enabled.)

audit.alfresco-access.enabled=true

This property controls the generation of the audit data, which can be viewed from Alfresco Explorer and Share. It is by default disabled.

Configure Audit Filters

Once the audit Data Producers generate the data for any event, filters are applied to either accept or reject the event. The following is a sample filter configured out of the box in the repository.properties files at <alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco:

audit.filter.alfresco-access.default.enabled=true
audit.filter.alfresco-access.transaction.user=~System;~null;.*

audit.filter.alfresco-access.transaction.type=cm:folder;cm:content;st:site
audit.filter.alfresco-access.transaction.path=~/sys:archivedItem;~/ver:;.*

Each filter has the list of regular expressions separated by a semicolon. As per the previous setting, events generated for any content or folder, not under path archive and version, would be recorded. List of expressions for each property is evaluated from left to right, which allows filtration of various combinations of audit data.

To override any filter, copy the respective property in alfresco-global.properties and make the changes are per your need. Sample configuration is as shown in the following line of code:

audit.filter.alfresco-access.transaction.user=.*

Here we are accepting audit data generated by any user.

View audit trail

To view the audit trail of any content from Alfresco Explorer, locate the content and use the Preview in Template button, and select the show_audit.ftl template from the drop‑down list. The following screenshot shows sample audit trail of content:

Configuring the email subsystem

Alfresco provides various notifications to the users during the content management process. You need to configure Alfresco to use an existing e-mail server to send outbound e-mails. Similarly you can also use Alfresco as an e-mail server itself for all the inbound e-mails.

Outbound_SMTP email subsystem

Follow the given steps to configure Alfresco repository to send e-mails from an SMTP server:

  1. Edit the tomcat/shared/classes/alfresco/extension/alfresco-global.properties file.
  2. Add the following property and modify it as per your required value as follows (you can delete any unmodified property, because it will retain the default value from tomcat/webapps/alfresco/WEB-INF/classes/subsystems/email/OutboundSMTP/outboundSMTP.properties):
           mail.host=<the name of your SMTP host>
           mail.port=<the port that your SMTP service runs on 
                                                     (the default is 25)> 
           mail.username=<the username of the account you want e-mail to be sent from >
           mail.password=<the password>
           mail.from.default=<the default FROM email address>
  3. Restart Alfresco.
Inbound_SMTP email subsystem

In order to configure Alfresco as inbound e-mail server perform the following steps:

  1. Edit the tomcat/shared/classes/alfresco/extension/alfresco-global.properties file.
  2. Add the following property and modify it as per your required value as follows (you can delete any unmodified property, because it will retain the default value from tomcat/webapps/alfresco/WEB-INF/classes/subsystems/email/InboundSMTP/inboundSMTP.properties):
    email.server.port= provide port of your email server(default 25)
       email.server.domain= provide domain address of your email server
  3. Restart Alfresco.

Also there are other settings in the file such as blocked list and allowed list, which can be configured as per your needs.

Configuring IMAP

Alfresco supports IMAP protocol. With IMAP, e-mail applications such as outlook and thunderbird can connect and interact with Alfresco. In order to enable IMAP in Alfresco perform the following steps:

  1. Edit the tomcat/shared/classes/alfresco/extension/alfresco-global.properties file.
  2. Add the following property and modify it as per your required values:
    imap.server.enabled=true <Enable or disable the imap>
    imap.server.port=143 <Imap server port>
    imap.server.host=x.x.x.x <IP address of Alfresco server. Don't give value as localhost>
  3. Restart Alfresco.

Once the IMAP is enabled, you can connect to Alfresco using any e-mail client. There would be an inbox folder created, where you can directly place your e-mails.

Configuring the FileServers subsystem

One of the unique strengths of Alfresco is the ability to access the repository through a variety of interfaces such as FTP, WebDav, and CIFS. These interfaces are referred to as the virtual file system.

To customize the default FTP and CIFS file server configuration values, you must override the values in the alfresco-global.properties file. CIFS and FTP are enabled by default. For any configuration of fileservers bean, use the subsystem extension mechanism.

Configuring CIFS

In order to configure CIFS perform the following steps:

  1. Edit the tomcat/shared/classes/alfresco/extension/alfresco-global.properties file.
  2. Add the following properties and modify it as per your requirements. You can delete any unmodified property, because it will retain the default value from tomcat/webapps/alfresco/WEB-INF/classes/subsystems/fileServers/default/file-servers.properties:
    cifs.enabled=true
    cifs.serverName=${localname}A
    cifs.domain=<domain/workgroup of the server optional property>
    
    cifs.tcpipSMB.port=445
    cifs.netBIOSSMB.sessionPort=139
    cifs.netBIOSSMB.namePort=137
    cifs.netBIOSSMB.datagramPort=138

    TCP and NETBIOS property can be changed to non-privileged ports. These properties are required for non-Windows machines.

  3. Restart Alfresco.

Configuring File System Transfer Receiver

Many a times we have requirement where we need to transfer content from repository to any remote file system. Alfresco provides this facility to transfer content from Alfresco repository to any target, such as remote file system.

Perform the following steps to configure File System Transfer Receiver on external file system, where you want to transfer the content.

  1. Download the Alfresco specific version ZIP bundle for File System Transfer Receiver.
  2. Extract the ZIP bundle. The ZIP bundle has the transfer receiver associated files and embedded Tomcat. It runs as standalone application.
  3. Edit the following property as per your needs in the ftr-launcher.properties file located at <FSTR Dir>/classes:
           ftr.tomcat.portNum=<FSTR tomcat port (default 9090)>
  4. Execute the following command to start the File System Transfer Receiver system:
          java –jar file-transfer-receiver.jar

Once the File System Transfer Receiver is started, your remote file system can now receive the files transferred from Alfresco.

Setting up a multi-tenant environment

Multi-tenancy (MT) is a software architecture where a single instance of the software runs on a software-as-a-service (SaaS) vendor's servers, serving multiple-client organizations (tenants). With a multitenant architecture, a software application is designed to virtually partition its data and configuration so that each client organization works with a customized virtual application instance.

Alfresco ECM can be configured as a true single-instance multi-tenant environment. The Alfresco instance is logically partitioned in such a way that it will appear to each tenant that they are accessing a completely separate instance of Alfresco.

Enabling multi-tenancy

Multi-tenancy comes preconfigured in Alfresco but disabled. It gets enabled on creation of first tenant.

The default Alfresco admin user can be considered as the "super tenant". All tenants can be administered by this super tenant admin user with the Tenant Administration Console.

Log in to Alfresco Explorer (http://<servername>:<port>/alfresco) using the admin user ID and password. The URL to the tenant administration console is http://<Alfresco Explorer URL>/faces/jsp/admin/tenantadmin-console.jsp, which is http://localhost:8080/alfresco/faces/jsp/admin/tenantadmin-console.jsp, as shown in the following screenshot:

To test the multi-tenancy features, create a tenant account using Tenant Admin Console.

create funcorp.com pwmike /usr/tenantstores/funcorp

Where funcorp.com is the domain, pwmike is the tenant administrator's password, and funcorp is the name of tenant store. Now will be the administrator for the tenant account funcorp.com.

There are few limitations of multi-tenancy. Multi-tenancy is not supported when we use SOLR with Alfresco. CIFS, Record Management, LDAP authentication, and IMAP doesn't support multi-tenancy.

High availability

In real-time scenarios, we have large-scale system where high availability of the system becomes a must. System should be available with minimum downtime. Alfresco provides high availability with clustering. Cluster is collection of multiple instance of Alfresco, each known as node. With simple configuration we can achieve clustering of nodes. The following components of Alfresco need to be synchronized across each cluster:

  • Database
  • Content Store
  • Lucene Indexes
  • Level 2 cache

Let us consider a scenario where we have two separate web applications accessing the same repository (database and content store). Each web application has its own local indexes and cache. Refer to the following diagram:

Perform the following steps to set up such clustering:

  1. Install Alfresco following the steps mentioned in Chapter 2, Installing Alfresco. Make sure clock times on both the servers are in sync.
  2. Set common database property in the alfresco-global.properties file for both nodes.
  3. Set the dir.root property in alfresco-global.properties of both nodes pointing to shared content store location. Make sure shared content store is accessible from both nodes.
  4. Make sure you are using lucene. Set the following properties as per your requirements in the alfresco-global.properties file:
           dir.indexes=<Absolute path of indexes location>
           index.subsystem.name=lucene (By default this is solr)
  5. Set the cluster name and index synchronization properties in the alfresco-global.properties file. Each node in cluster should have same name. Alfresco uses this property to identify the nodes.
           alfresco.cluster.name=<CLUSTERNAME>
           index.recovery.mode=Auto
           index.tracking.cronExpression= 0/5 * * * * ?
  6. Set the Jgroup property. It allows to communicate between nodes using UDP or TCP protocol. By default it is UDP.
    alfresco.jgroups.bind_address=<Server IP address>
    alfresco.jgroups.bind_interface=<Network Interface>
  7. Rename the file ehcache-custom.xml.sample.cluster located at <alfresco>tomcat/shared/classes/alfresco/extension to ehcache-custom.xml.

Verify the clustering by creating content on one node. It should be automatically synchronized on a second node.