Installing Social Office for Production Use
Eventually, you'll want to install Social Office onto a production server. Unlike Liferay Portal, which can be downloaded both as a standalone .war file or as a bundle, Social Office has been simplified by distributing it as a bundle with an application server. This greatly simplifies the setup and configuration for Social Office, as there's significantly fewer steps to get a bundle up and running.
Unzip the bundle or install it to the location from which you're going to run it using the instructions above. For example, you might use D:\apps in Windows or /opt in Linux or UNIX variants. As we mentioned before, the default bundle installation of Social Office uses an embedded database. While this works great for rapid evaluation or development, it has several drawbacks:
Only one user can access it at a time since the data is stored on a file on disk and HSQL locks it when doing changes.
The data is stored inside the bundle and might be lost on redeployment.
This configuration doesn't scale well and will perform poorly once multiple users access the system.
For these reasons, you don't want to run Social Office against the embedded database. Fortunately, Social Office has great support for most production-ready databases, and it's easy to configure Social Office to use them. The exact instructions will depend on the database, but here's a summary:
Create the database in your DBMS of choice (see the section below labeled Database Setup for further information).
Create a portal-ext.properties file in the Social Office Home folder which points to the database and mail session.
Start Social Office. Social Office will create the tables automatically and start.
As you can see, this is a simple, three step process. Using MySQL as an example, we'll go over the exact settings in portal-ext.properties below.
First things first, let's get that database set up. Using your database vendor's tools, create your database and grant a user ID full access to it. You'll eventually configure Social Office to connect to the database using this user ID. Once this is completed, the first time Social Office starts it'll create the indexes and tables automatically.
Social Office Home
In Social Office, there's a folder named Home. This folder is the top level folder that was extracted from the .zip file or the location you installed Social Office via the installer.
Social Office Home is primarily used for storing special configuration files, like portal-ext.properties. Please take a moment to find this folder on your system. We'll be creating a configuration file there.
The portal-ext.properties File
Liferay Social Office, like Liferay Portal, makes use of a configuration file to store its settings. These properties files differ from the configuration files of most other products in that changing the default configuration file is discouraged. In fact, the file that contains all of the defaults is stored inside of a .jar file, making it more difficult to customize. Why is Social Office set up this way? Because Liferay's products use the concept of overriding the defaults in a separate file rather than going in and customizing the default configuration file. You only change the settings you want to customize in your own configuration file, and then the configuration file for your software remains uncluttered and contains only the settings you need. This makes it far easier to determine whether a particular setting has been customized— and it makes the settings more portable across different installations of Liferay Portal and Liferay Social Office.
The default configuration file is named portal.properties, and the default version resides inside the core of Social Office. To override the settings in this file we use another, similarly named file called portal-ext.properties. This file is stored in your Social Office Home folder. By default, the file doesn't exist at all, so you'll need to create it to get Social Office connected to your database.
So let's get started pointing your Social Office bundle to your database. Create a file called portal-ext.properties in your Social Office Home folder. Since this file overrides default properties that come with Social Office, you're going to override the default configuration which points Social Office to the embedded HSQL database. Using the built in connection pool, you can easily connect Social Office to most popular database servers. The template for MySQL is provided as an example below.
In the configuration above, we're assuming the user name is mommy and the password is daddy. Obviously, you would instead use the user ID and password you configured earlier in your database. You would also point the JDBC URL to your database server, unless you're running the database on the same machine as Social Office.
For email there's a similar procedure using the built-in mail session. The mail session is a resource which enables communication between Social Office and your mail server. Please note: configuring the mail session properly is very important! Since several of Social Office's applications rely heavily email notifications, the ability to communicate with your mail server is essential. To configure the mail session, please add the following directives to your portal-ext.properties file (substituting your mail server information):
Save the file. You're all done! The next time you start Social Office, it'll connect to your database server and create the tables it needs to function.
We used MySQL above, just as an example, but of course Social Office supports most common databases. Below we've provided the templates for all of the supported databases. Use the template that corresponds to the one you're using.
Derby is an embedded database and is not recommended for production environments.
Hypersonic is an embedded database and is not recommended for production environments.
As you can see, Social Office supports a number of the leading databases in the industry today.
Social Office will take about a minute to launch while it creates the tables.. Once this is completed, a new browser window automatically opens and you'rre presented with the Sign In screen.