Sun GlassFish Web Space Server 10.0 Administration Guide

Installing the Database, Application Server, and Web Space Server

Perform the following procedure to configure Web Space Server on a Solaris system with UTF-8 support. For instructions about how to install MySQL on various other operating systems, see http://dev.mysql.com/doc/refman/5.1/en/installing.html.

Before You Begin

This section explains some basic requirements and concepts you should review before proceeding with Sun GlassFish Web Space Server 10.0 software installation.

System Requirements

See Software and Hardware Requirements in Sun GlassFish Web Space Server 10.0 Installation Guide for system requirements.

Installation Directories

Throughout these installation instructions, the root Web Space Server installation directory is referred to as <webspace_dir>.

When you unzip a core Web Space Server bundle (which looks similar to webspace-<version>-for-glassfish.zip), you get webspace-for-glassfish directory. You can install and configure Web Space Server from this directory. This directory is denoted by <webspace_dir>.

Platform-Specific Path Separators

The instructions and examples in this document use UNIX-style forward slash (/) path separators in file and command names. If Web Space Server and Sun GlassFish Enterprise Server are installed on a Windows system, be sure to use backslashes (\) instead of forward slashes; for example:

ProcedureTo Install and Configure MySQL

  1. Install MySQL by typing the following commands as superuser.

    # groupadd mysql
    # useradd -g mysql mysql
    # cd /usr/local
    # gunzip install-dir/mysql-version-os.tar.gz | tar xvf -
    # ln -s install-dir/mysql-version-os mysql
    # cd mysql
    # chown -R mysql .
    # chgrp -R mysql .
    # scripts/mysql_install_db --user=mysql
    # chown -R root .
    # chown -R mysql data
    # bin/mysqld_safe --user=mysql & *
  2. Log in to the MySQL installation by going to the MySQL installation directory and typing the following command:

    mysql -u root

  3. Create the UTF-8 database by typing the following commands:

    mysql> create database lportal default character set utf8
    mysql> use lportal;
    mysql> create user lportal;
    mysql> grant all privileges on *.* to 'lportal'@'localhost' identified by 'lportal';
    mysql> set password for 'lportal'@'localhost' = password('lportal');
  4. Enable UTF-8 support for MySQL.

    See, To Connect to a Database Other Than HSQL

ProcedureTo Install the GlassFish JAR Based Installer

Installing and starting GlassFish is a prerequisite for installing Web Space Server. The following procedure explains how to install the JAR based installer for GlassFish. The JAR based installer can be downloaded freely from the GlassFish server web site. You can use GlassFish V2 version and also the JAR based installer for GlassFish in case of desktop deployments of Web Space Server, which is used for development and testing of Web Space Server.

You can use the enterprise version of Web Space Server when you deploy Web Space Server in production environment. See, Installing Web Space Server on Sun GlassFish Enterprise Server 2.1.

  1. Download the GlassFish v2 distribution at

    https://glassfish.dev.java.net/downloads/v2.1-b60e.html

  2. Set the environment variable JAVA_HOME to point to the directory in which JDK 1.6 is installed.

  3. Run the following command:

    #java -Xmx256m -jar filename.jar

  4. Set ANT_HOME to point to the installation of Ant 1.7 or above.


    Note –

    Ant 1.6.5 is the default Ant version for GlassFish. Make sure that ANT_HOME is not pointing to GlassFish Ant.


  5. Navigate to the GlassFish directory:

    cd glassfish

  6. Run the following command:

    ant -f setup.xml

  7. Start GlassFish.

    cd bin

    <downloaded-dir>/glassfish/bin>/asadmin start-domain

ProcedureTo Install Web Space Server

  1. Download the stand-alone version of Web Space Server.

  2. Extract the Web Space Server bundle.

    unzip webspace-for-gfv2.zip

  3. Navigate to the Application folder.

    cd webspace-for-gfv2/webspace/application

  4. Run ant -f install-gfv2.xml.

    ant -f install-gfv2.xml
    Buildfile: install-gfv2.xml
    
    check-ant:
    
    check-last-install:
    
    set-last-install:
    
    show-user-warning:
       [input] JAVA_HOME must be set to JDK 1.5 or greater and java must be availab
    le in the execution path. GlassFish must be running. [RETURN to continue or CONT
    ROL-C to stop]
    
    
    set-glassfish-properties:
       [input] Enter GlassFish Directory  [\opt\glassfish]
    <install-dir>\glassfish
       [input] Enter GlassFish Domain (include full path to domain)  [<install-dir>\glassfish\domains\domain1]
    
       [input] Enter GlassFish Target  [server]
    
       [input] Enter GlassFish Administrator [admin]
    
       [input] Enter GlassFish Administrator Password File (include full path to fi
    le)  [full-path\gfpass.txt]
    
       [input] Enter GlassFish Administration Port  [4848]
    
       [input] Can installer deploy wars?  [true]
    
    
    set-database-properties:
       [input] Use builtin HSQL or mySQL database  [HSQL]
    mysql
    
    set-hsql-properties:
    
    set-mssql-properties:
    
    set-mysql-properties:
       [input] Enter Database User Name  [root]
    
       [input] Enter Database User Password File (include full path to file)  [full-path\dbpass.txt]
    //Place GlassFish admin password in a clear text file, and specify full path to it
    
       [input] Enter Database Host  [localhost]
    
       [input] Enter Database Port  [3306]
    
       [input] Enter Database Name  [lportal]

    You need to set the application server and database properties in the process of running install-gfv2.xml. You have to specify path for a password file (a text file containing the password) for GlassFish. If MySQL is installed on your machine, stop GlassFish and choose MySQL instead of the HSQL database, and make changes to the portal-ext.properties file as described in the To Connect to a Database Other Than HSQL section. Provide a password file, and restart GlassFish. Provide properties such as hostname, port number, and database name. Make sure that Ant version is 1.7 or greater and JDK is 1.6 or greater. GlassFish need to be running if you are installing on HSQL.

ProcedureTo Connect to a Database Other Than HSQL

You need to make changes to the JDBC property in portal-ext.properties only when you are installing Web Space Server on GlassFish Enterprise Edition. It is not necessary to make these changes, when you are installing Web Space Server on the GlassFish JAR based installer.

  1. Create a temporary folder. In this example, the folder is named test.

    mkdir /tmp/test

  2. Copy the portal-impl.jar file to the tmp folder.

    The portal-impl.jar file contains resource bundles for Web Space Server.

    cd GlassFish-install-dir/domains/domain1/application/j2ee-modules

    cp webspace/WEB-INF/lib/portal-impl.jar /tmp/test

  3. Change to the tmp directory.

    cd /tmp/test

  4. Extract the portal-impl.jar file.

    jar -xvf portal-impl.jar

    The portal.properties file will be placed in the tmp directory.

  5. Open the portal.properties file and copy the JDBC property.

  6. Create a text file named portal-ext.properties, and paste the JDBCproperty into it.

    The Hypersonic (HSQL) and MySQL part of the JDBC property looks as below:

    #
        # Hypersonic
        #
        jdbc.default.driverClassName=org.hsqldb.jdbcDriver
        jdbc.default.url=jdbc:hsqldb:lportal
        jdbc.default.username=sa
        jdbc.default.password=
    
        #
        # MySQL
        #
        #jdbc.default.driverClassName=com.mysql.jdbc.Driver
        #jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=
    UTF-8&useFastDateParsing=false
        #jdbc.default.username=
        #jdbc.default.password=
  7. Comment Hypersonic (HSQL) and uncomment MySQL.


    Note –

    Properties in the portal properties file are commented using the hash (#) symbol. A property can be commented by placing a hash symbol in front of it.


  8. Save the portal-ext.properties file.

  9. Create a directory structure webspace/WEB-INF/classes/ under ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace/customs, and copy portal-ext.properties file to it.

  10. Change directory to ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace.

    cd ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace

  11. Run ant -f synchronize.xml.

  12. Restart the GlassFish server.

    The server will redeploy websynergy.war and update portal-ext.properties under applications/j2ee-modules/webspace/WEB-INF/classes.

UTF-8 Support for Oracle 10g or Later

When you configure Web Space Server for Oracle, the lportal database needs to be created with UTF-8 support.

CREATE DATABASE lportal    
   CHARACTER SET [AL32UTF8|UTF8]
   NATIONAL CHARACTER SET AL16UTF16

CHARACTER SET Clause

Type the character set, the database uses to store data. The supported character sets and default value of this parameter depends on your operating system.

Restriction on the CHARACTER SET


Note –

Do not specify the AL16UTF16 character set as the database character set.


Specify the national character set used to store data in columns specifically defined as NCHAR, NCLOB, or NVARCHAR2. Values allowed are AL16UTF16 and UTF8. The default value is AL16UTF16.

Also, refer to the Oracle Database Globalization Support Guide for information on Unicode data-type support. You can access this document at

http://download.oracle.com/docs/cd/B12037_01/server.101/b10749/toc.htm