Microsystems Technology Laboratories > OpenCoral

Compile OpenCoral

This section will describe how to perform initial configuration of the OpenCoral servers.

Initial Configuration

Now that we have the source code, the first thing you want to do is to setup all the configuration properties. OpenCoral has a java application called Configurator that helps you determine the correct value for each property. It is a Swing application and requires authorization to open up a display on your X terminal.

This usually means setting your DISPLAY environment variable and opening up your X connection using xhost +localhost or the equivalent host as needed.

The Configurator first prompts for the site and instance value. In most cases, the site will be the domain of your institution. If yours is the only facility (or at least the first facility) on campus to be running Coral, please use your e-mail domain name as the site. Since each site may have multiple instances of OpenCoral running (either in multiple facilities or within a single facility as a production or development instance, for example), the site and instance properties will differentiat your properties files from others sites and instances. To run the Configurator, do the following and type in the appropriate value for site when prompted. If this will be your production version, enter prod as the instance. If it will be a development version, for example, enter dev or another short, but descriptive, identifier. Note: in the following, we have assumed that the OpenCoral source files downloaded from the CVS repository were downloaded into the directory ~coral/opencoral. If your files are located in another location, please adjust this directory accordingly. The build and configuration process is not dependent on the location of the source files.

$ cd ~coral/opencoral
$ ant configure
Buildfile: build.xml
Trying to override old definition of task switch

    [input] What is this site?: 
    [input] Will this be the default site?: (y,n)

    [input] What is this instance?: 
    [input] Will this be the default instance?: (y,n)


    [javac] Compiling 5 source files to ~coral/opencoral/configurator/classes
      [jar] Building jar: ~coral/opencoral/configurator/lib/configurator.jar
[xmlvalidate] 1 file(s) have been successfully validated.
     [java] File not found error while reading properties file: java.io.FileNotFoundException: config/demo-dev.properties (No such file or directory)

The file not found error is normal since we have not yet create properties files using the Configurator. Click "OK".

File Not Found

You will get another notice dialog box about properties being highlighted. Just click "OK".

Properties highlighted

Finally, the Properties Configurator is displayed. You'll find many tabs organized into different functions. Go through each tab and fill out all fields that apply. If you are not sure what values you should put in, click on the ? button to the right of each parameter to get some hints as to the proper values to input.

View of Configurator

An example of a hint dialog box.

View of Configurator

When you are all done filling all the properties, click on File, Write properties file to save your properties files.

View of Configurator

If your properties change, you can always run the Configurator again with the same command. This time, you will not get the file not found error.

The Configurator basically puts all these properties into several files under the ~coral/opencoral/config directory. Three key files will be your_institution-your_instance.properties (e.g., the Somesite production properties file will be named somesite-prod.properties), .defaultSite.properties, and .defaultInstance.properties.


Before compiling, we need to generate a keystore so that our jars can be signed. The keystore named .signstore needs to be located at [opencoral.install.dir]/etc/private. The generate this keystore, we use keytool provided in the J2SDK tools. First create the directories as root for the keystore and certs. This is called a "self-signed" certificate that will be used to sign the JAR files that your users will download when they are running remote Coral from their home or desktop machines. A self-signed certificate results in more warnings than if you have and uuse a "real" code signing certificat that is provided by one of the trusted signing authorities such as Thawte or Verisign. You may wish to install a real code signing certificate at a later date.

# cd /usr/local
# mkdir coral
# cd coral
# mkdir etc
# cd etc
# mkdir private
# cd /usr/local/coral
# mdkir share
# cd share
# mkdir certs
# cd /usr/local
# chown -R coral:opencoral coral

Now as coral, generate the keystore

$cd /usr/local/coral/etc/private
$keytool -genkey -alias coralkey -keyalg rsa -keystore .signstore
Enter keystore password:  [keystore.password]
What is your first and last name?
  [Unknown]:  OpenCoral Software
What is the name of your organizational unit?
  [Unknown]:  your_organization
What is the name of your organization?
  [Unknown]:  your_institution
What is the name of your City or Locality?
  [Unknown]:  your_city
What is the name of your State or Province?
  [Unknown]:  your_state
What is the two-letter country code for this unit?
  [Unknown]:  US
Is CN=OpenCoral SysAdmin, OU=your_organization, O=your_institution, L=your_city, ST=your_state, C=US correct?
  [no]:  yes

Enter key password for <coralkey>
        (RETURN if same as keystore password):  

Compile all OpenCoral components with the following command run as user coral:

$ cd ~/opencoral
$ ant build

Note, because the build process generates a lengthy log file, you may wish to save a copy of that file for later reference. You can do that by issuing the command ant build | tee build.log which will both generate the log file that you normally see on the screen as well as pipe a version of it to the file named build.log.

When the compile starts, you'll be prompt for the following three values: 1. JDBC password to connect to the database. This basically writes to ~coral/opencoral/config/.dbpw-dev.properties.

Set database password

2. Jarsign store password. This is the one you've set in the previous step. This basically writes to ~coral/opencoral/config/.jspw-dev.properties.

Set jarsign store password

3. Jarsign key password. This is the one you've set in the previous step. This basically writes to ~coral/opencoral/config/.jspw-dev.properties.

Set jarsign key password

If you encounter any problems during the build process, the error messages will likely give you an idea what is wrong. If you are unclear as to the nature of the problem, please contact the local coral developers.